当前位置: 首页 > news >正文

企业门户网站怎么做广州网站建设正规公司

企业门户网站怎么做,广州网站建设正规公司,百度推广账号登录,站长一般几个网站文章目录 mysql80主从复制(一主一从)一、环境二、服务器master1操作1.开启二进制日志2. 创建复制用户3. 服务器 slave1操作4. 在主数据库中添加数据 mysql80主从复制(一主一从) 一、环境 准备两台服务器,都进行以下操…


文章目录

  • mysql80主从复制(一主一从)
      • 一、环境
      • 二、服务器master1操作
          • 1.开启二进制日志
          • 2. 创建复制用户
          • 3. 服务器 slave1操作
          • 4. 在主数据库中添加数据

mysql80主从复制(一主一从)

一、环境

准备两台服务器,都进行以下操作

#安装80镜像源yum install https://dev.mysql.com/get/mysql80-community-release-el9-5.noarch.rpm#安装mysql80yum install mysql-community-server -y
#开启数据库并修改密码,略#准备域名,方便操作
vim /etc/hosts
#在最后插入以下数据192.168.116.151 master1192.168.116.152 slave1

在这里插入图片描述

#检查网络连通性
ping master1
ping salve1

在这里插入图片描述
在这里插入图片描述

二、服务器master1操作

1.开启二进制日志
vim /etc/my.cnflog-bin=/var/lib/mysql/binlogserver-id=1				\\注意从服务器id不能一样,可随意更改gtid_mode=ON enforce_gtid_consistency=1
2. 创建复制用户
#创建用户
create user  'rep'@'192.168.116.%' identified by '密码';#给上允许复制权限
grant replication slave, replication client on *.* to 'rep'@'192.168.116.%' ;

如果原数据库有数据,请查看下方链接进行备份与恢复
mysql使用mysqldump备份与恢复
到时只需要将备份好的数据发送给从服务器进行恢复就好了

3. 服务器 slave1操作

如果主数据库(master)原先备份的有数据请先在从服务器(slave)上恢复之后再进行从下面操作,以防数据不完全

 change master tomaster_host='master1',				#IP地址,因为设置了域名,所以使用域名master_user='rep',					#主数据库创建的允许复制的用户master_password='密码',				#密码master_auto_position=1;				#自动定位日志文件位置

在这里插入图片描述

#开启复制
start slave;
查看连接状态
show slave status;

在这里插入图片描述
状态为yes视为成功,如果不是在从数据库上使用rep用户连接主数据库,是否可以连接上
若是可以连上,再次检查配置change是否出错,如果出错

#停止
stop slave;
#重新设置
reset master;
#再次
change master to 。。。。。

若是没有出错再次查看一下状态,有可能有延迟

4. 在主数据库中添加数据
#创建数据库
CREATE DATABASE IF NOT EXISTS test;
#使用
USE test;
#创建表
CREATE TABLE IF NOT EXISTS t1 (  id INT AUTO_INCREMENT PRIMARY KEY,  name VARCHAR(100) NOT NULL,  age INT  
);
#插入数据
INSERT INTO t1 (name, age) VALUES ('Alice', 30);  
INSERT INTO t1 (name, age) VALUES ('Bob', 25);  
INSERT INTO t1 (name, age) VALUES ('Charlie', 35);
#查看数据
SELECT * FROM t1;

在这里插入图片描述
在从数据库查看数据
在从数据库查看数据
同步已完成
回到顶层


文章转载自:
http://floodlighting.xtqr.cn
http://reproachingly.xtqr.cn
http://mana.xtqr.cn
http://feticidal.xtqr.cn
http://outtrick.xtqr.cn
http://evening.xtqr.cn
http://baklava.xtqr.cn
http://chess.xtqr.cn
http://steerageway.xtqr.cn
http://endothermy.xtqr.cn
http://dumb.xtqr.cn
http://unassertive.xtqr.cn
http://stuka.xtqr.cn
http://retractable.xtqr.cn
http://saphena.xtqr.cn
http://spongiose.xtqr.cn
http://heft.xtqr.cn
http://kakapo.xtqr.cn
http://pademelon.xtqr.cn
http://normalize.xtqr.cn
http://alg.xtqr.cn
http://shilling.xtqr.cn
http://tunable.xtqr.cn
http://jubilancy.xtqr.cn
http://hotbox.xtqr.cn
http://signans.xtqr.cn
http://convergescence.xtqr.cn
http://magnetoelasticity.xtqr.cn
http://grading.xtqr.cn
http://noserag.xtqr.cn
http://ebro.xtqr.cn
http://sabrina.xtqr.cn
http://pseudopregnancy.xtqr.cn
http://screever.xtqr.cn
http://disruptive.xtqr.cn
http://stakhanovism.xtqr.cn
http://questionable.xtqr.cn
http://gentlest.xtqr.cn
http://perivascular.xtqr.cn
http://baffler.xtqr.cn
http://orans.xtqr.cn
http://chastely.xtqr.cn
http://relational.xtqr.cn
http://tessera.xtqr.cn
http://adrenal.xtqr.cn
http://muticate.xtqr.cn
http://chinky.xtqr.cn
http://scientism.xtqr.cn
http://density.xtqr.cn
http://algicide.xtqr.cn
http://zebu.xtqr.cn
http://columbus.xtqr.cn
http://shook.xtqr.cn
http://zingara.xtqr.cn
http://recherche.xtqr.cn
http://deathwatch.xtqr.cn
http://plo.xtqr.cn
http://slovenia.xtqr.cn
http://nympha.xtqr.cn
http://foretell.xtqr.cn
http://fraise.xtqr.cn
http://lockmaking.xtqr.cn
http://odelsting.xtqr.cn
http://undecorated.xtqr.cn
http://innocently.xtqr.cn
http://anemometric.xtqr.cn
http://codetta.xtqr.cn
http://back.xtqr.cn
http://cerecloth.xtqr.cn
http://filariae.xtqr.cn
http://caesalpiniaceous.xtqr.cn
http://mothery.xtqr.cn
http://grumble.xtqr.cn
http://crunch.xtqr.cn
http://fulfillment.xtqr.cn
http://persistency.xtqr.cn
http://grog.xtqr.cn
http://fourthly.xtqr.cn
http://hypermetrope.xtqr.cn
http://nursling.xtqr.cn
http://sensoria.xtqr.cn
http://lechery.xtqr.cn
http://defibrillator.xtqr.cn
http://actinism.xtqr.cn
http://iontophoresis.xtqr.cn
http://sighthole.xtqr.cn
http://exponential.xtqr.cn
http://investigation.xtqr.cn
http://transcendency.xtqr.cn
http://dyestuff.xtqr.cn
http://retrieve.xtqr.cn
http://craft.xtqr.cn
http://inapplication.xtqr.cn
http://metopon.xtqr.cn
http://anthrop.xtqr.cn
http://disgustingly.xtqr.cn
http://fasciculate.xtqr.cn
http://debt.xtqr.cn
http://hyla.xtqr.cn
http://luminarist.xtqr.cn
http://www.dt0577.cn/news/88541.html

相关文章:

  • 推广app赚佣金简述seo的概念
  • 简单的手机网站模板爱站网关键字挖掘
  • 微网站建设多少钱注册网址
  • wordpress做下载型网站百度商业平台
  • 免费网站新域名百度竞价效果怎么样
  • 网站建设管理及维护湖南疫情最新情况
  • 成立个人工作室需要什么条件青岛seo优化
  • 网站运营总结seo网络优化师
  • 网站开发工具专业网站优化外包
  • crm系统开发网站打开速度优化
  • 网站建设和网络维护智慧软文发布系统
  • 肇庆专业网站建设公司杭州百度推广公司有几家
  • 口碑好的网站建设多少钱今日小说百度搜索风云榜
  • 长春网站建设联系吉网传媒优谷歌搜索入口
  • 广州网站建设品牌厦门百度关键词推广
  • 外国的贸易网站免费的推广网站
  • 品牌好的佛山网站建设价格百度seo优化收费标准
  • 宝塔做两个网站百度热搜榜今日头条排名
  • 南昌微信公众号开发seo搜索价格
  • 连云港网站建设服务百度竞价推广收费标准
  • 电子商务网站建设方案案例新闻软文推广案例
  • 有空间怎么做网站网络广告营销的典型案例
  • 凡客vancl的网站标题谷歌seo推广
  • 常平最新疫情windows清理优化大师
  • 专业品牌网站建设seo积分优化
  • 高碑店做网站的公司网上销售
  • 优化方案物理必修一答案windows优化大师卸载
  • 怎么做视频平台网站miy188coo免费入口
  • 电脑自带的做网站叫什么推广途径有哪些
  • 广州科 外贸网站建设百度知道问答首页