mysql 主从配置

MySQL主从配置 文章目录MySQL主从介绍MySQL主从原理图MySQL主从配置主配置(安装完mysql的虚拟机)从配置(安装完mysql的虚拟机)检验主从配置是否正常几个配置参数测试主从 MySQL主从介绍 MySQL主从又叫做Replication、AB复制。简单讲就是A和B两台机器做主从后,在A上写数据,另外一台B也会跟着写数据,两者数据实时同步的 MySQL主从是基于binlog的,主上须开启binlog才能进行主从。 主从过程大致有3个步骤 1)主将更改操作记录到binlog里 2)从将主的binlog事件(s 阅读详情

mysql 主从配置

master
1.cd /etc/my.cnf

#mysql服务ID,保证mysql集群环境中唯一
server-id=1

#mysql二进制日志文件存放路径和文件名称
log-bin=/var/lib/msyql/mysqlbin

#该节点读写状态,1-只读,0-读写
read-only=0

#忽略需要参与主从备份的库
binlog-ignore-db=mysql

service mysql restart

2.创建同步数据的账户,并且进行授权操作。在主库主机的用户,主要用于I/Othread

1.create user 'repl'@'192.168.136.130' IDENTIFIED BY '123456';
2.grant replication slave on *.* to 'repl'@'192.168.136.130';
或
grant replication slave on *.* to 'repl'@'192.168.136.130' identified by '123456';
flush privileges;
show master status;

//130ip地址为备库的ip地址,只允许这个ip地址可以登陆

从节点
1.server-id=2
2.log-bin=/var/lib/mysql/mysqlbin
3.service mysql restart;

stop slave;
change master to master_host='192.168.136.128', ,master_port=3306,master_user='repl',master_password='123456',master_log_file='mysqlbin.000001', master_log_pos=154;
start slave;
reset master;
show slave status;


执行show slave stauts
若报错:
1.Slave_IO_Running: Connecting
2.Last_IO_Error: error connecting to master 'repl@192.168.136.128:3306' - retry-time: 60 retries: 1 message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
主库执行:grant ALL PRIVILEGES on *.* to 'repl'@'192.168.136.130';

若报错:
Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
在主从库查看server-id或uuid是否一样
show variables like '%server%';
不一样,删除或修改auto.cnf中uuid值
mysql的主从配置 MySQL 主从又叫做 Replication、AB 复制。简单讲就是 A 和 B 两台机器做主从后,在 A 上写数据,另外一台 B 也会跟着写数据,两者数据实时同步的。MySQL 主从是基于 binlog 的,主上须开启 binlog 才能进行主从。主从过程大致有 3 个步骤:1)主将更改操作记录到 binlog 里2)从将主的 binlog 事件(sql 语句)同步到从本机上并记录在 relaylog里中继日志3)从根据 relaylog 里面的 sql 语句按顺序执行。 阅读详情

相关推荐

手把手教你做基于stm32的红外、语音、按键智能灯光控制(上)

这次项目使用的板子是stm32f103c8t6最小系统板,这个板子在tb上都能够买到,随便一个最小系统板都可以,== 注意在买最小系统板的时候需要买一个stlink下载器来下载程序。显示模块是使用的0.96英寸的OLED屏幕,注意是使用的IIC通信协议的OLED屏幕,不是使用SPI总线协议的。这次写的代码还顺便集成了检测温湿度的功能,所以要使用DHT11温湿度传感器,来采集温度。本文所设计的基于单片机的灯光控制系统主要由模式选择功能、手动模式和自动模式组成。LED灯自然就是要控制的部件了。

nbbskk的博客 6559

mysql配置主从-gtid模式

mysql配置主从

Tyler唐的博客 1万+

MIC卡的OFED驱动安装

 IB网络和OFED驱动安装 IB InfiniBand是一个统一的互联结构,可以处理存储I/O、网络I/O和进程间通信(IPC)。它可以将磁盘阵列、SANs、LANs、服务器和集群服务器进行互联,也可以连接外部网络(比如WAN、VPN、互联网)。设计InfiniBand的目的主要是用于企业数据中心,大型的或小型的。目标主要是实现高的可靠性、可用性、可扩展性和高的性能。Inf

beglorious的专栏 5108

MySQL主从数据库配置

在开发工作中,有时候会遇见某个sql 语句需要锁表,导致暂时不能使用读的服务,这样就会影响现有业务,使用主从复制,让主库负责写,从库负责读,这样,即使主库出现了锁表的情景,通过读从库也可以保证业务的正常运作。有了主从复制,增加多个数据存储节点,将负载分布在多个从节点上,降低单机磁盘I/O访问的频率,提高单个机器的I/O性能。在一主多从的数据库体系中,多个从服务器采用异步的方式更新主数据库的变化,业务服务器在执行写或者相关修改数据库的操作是在主服务器上进行的,读操作则是在各从服务器上进行。

m0_74090215的博客 4178

CST入门——0. 安装CST Studio Suite 2022

安装CST Studio Suite 2022详细操作步骤

plmxu34的博客 6万+

【开关电源篇】开关电源——只需这三个阶段,从电源小白到维修大神

🔌 该篇为的原创文章跳转目录,小二持续更新跳转链接,尽情关注!

2301_81299416的博客 2402

Mysql主从配置

保姆式mysql主从配置

2301_80286384的博客 4478

Oracle OCP 19c 认证1Z0-083考试大纲(Oracle官方版)

Oracle Database: Managing Multitenant Architecture Ed 1 course

#真题在线# 1591

如何配置mysql主从

如何配置mysql主从

weixin_65309423的博客 3456

Versal ACAP NoC实战:像理解计算机网络一样配置AXI NoC,打通PS与PL数据通路

本文深入探讨了Versal ACAP NoC的配置与优化,通过计算机网络类比解析NoC架构,详细介绍了在VD100开发板上配置AXI NoC实现PS与PL数据交互的实战步骤。文章涵盖NoC组件功能、Vivado配置技巧、性能优化方法及常见问题解决方案,帮助开发者高效打通Versal芯片的数据通路。

weixin_42665255的博客 294

MetaERP 的管理单元在设计哲学和实现逻辑上,确实与 Oracle EBS 的业务实体(OU)一脉相承,你可以放心地在已知的 Oracle 多组织架构框架下进行理解。它并没有推翻这套经典的核算模型

MetaERP的管理单元设计继承了Oracle EBS业务实体(OU)的核心思想,并进行了现代技术重构。管理单元(MU)作为OU的超集,延续了业务数据隔离与流程执行边界的定位,但通过元数据驱动的多租户架构实现更灵活的数据隔离。MetaERP采用三层解耦设计(核算单元、自然科目、核算维度),解决了EBS科目组合爆炸问题,并实现事件驱动的实时核算。相较于EBS的批处理模式,MetaERP通过云原生架构和元数据驱动配置,显著提升了灵活性、实时性和扩展性,支持跨法人的业务统一管理视图。

金牌架构师 577

Docker中Mysql的主从配置

一般来说为了保证Mysql的高可用的高性能,会做分库分表、读写分离、Mysql集群等一些操作,如果时读写分离,那么主从配置就是读写分离的前置,需要有主从的服务,才会有主库负责写,从库负责读的优化。 文章目录前言配置一、创建mysql容器二、备份主库数据到从库三、Mysql开启主从配置 前言 如果是新创建Mysql服务器会比较简单,直接配置即可,如果是主库中已经有数据了,那么则需要将从库中的数据和主库中保持一致才可以。 (特别注意:主库和从库的版本最好保持一致,还有数据库的字符集编码、数据表的字符集编码都.

第一行代码 478

Unity 编辑器篇|(一)MenuItem菜单栏

"一级菜单/二级菜单上/三级菜单""一级菜单/二级菜单中 %#_B""一级菜单/二级菜单下 %&_C""一级菜单/二级菜单中 %#_B""一级菜单/二级菜单下 %&_C""GameObject/二级菜单""CONTEXT/组件名/菜单名""一级菜单/二级菜单上 #_A""Assets/二级菜单""一级菜单/二级菜单下""一级菜单/二级菜单上""一级菜单/二级菜单中""一级菜单/二级菜单下""一级菜单/二级菜单下""一级菜单/二级菜单上""一级菜单/二级菜单中""一级菜单/二级菜单下""自定义/Test"

游戏开发小Y的博客 13万+

mysql主从配置干什么_MySQL主从配置

------------恢复内容开始------------MySQL主从配置MySQL主从又叫做Replication、AB复制,两台机器做主从配置之后,数据实时同步主从配置大致步骤①主将更改操作记录到binlog里②从将主的binlog事件(sql语句)同步到从本机上并记录在relaylog里,中继日志③从根据relaylog里面的sql语句按顺序执行主配置(安装完mysql的虚拟机)基础配置...

weixin_33487490的博客 221

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

MySQL数据库主从配置

一丶安装MySQL数据库 二丶修改主数据库配置 1.在/etc/my.cnf中设置服务id(注:保证与从数据库不一致),重启数据库 2.查询数据库master的基本数据,记录保存备用; (1).mysql -u(userName)-p 进入数据库命令行 (2).输入show master status; 查询master数据 记录file,Position数据 文件“binlog.000015”和偏移量“2832”; 3.创建一个可以跨域的账户,以保证从服务器可以登陆主服务器的mysql数据库 cr

小学生 9464

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

mysql主从配置实现_MySQL主从配置实现

//////////////////////MySQL主从配置////////////////////////////首先,两边都要安装MySQL,启动两边的MySQL接着,配置主从,要保证主从数据都一样的可以用rsync弄过去在主上配置/etc/my.cnfserver-id=1log-bin=mysql-bin两个可选参数(2选1)binlog-do-db=db1,db2... #需要同步的库...

weixin_39989033的博客 202

mysql主从配置duxi_mysql主从配置

mysql的主从配置1、主从简介在现代企业中,数据库显得尤为重要,而储存数据的数据库选择的五花八门,但任何数据库都存在着一种隐患。想几个问题:用一台服务器存放数据,若此数据库服务器出问题导致数据库丢失怎么办?业务量大了,数据多了,访问人多了,一台数据库无法保证服务器质量怎么办?1.1、主从作用实时灾备,用于故障切换读写分离,提供查询服务备份,避免影响业务1.2、主从形式一主多从主主复制一主多从多主...

weixin_35064596的博客 261

windows 下mysql主从配置_windows环境下mysql主从配置

mysql主从配置。相关理论知识可以百度一下,这里就不多说了,直接说如何配置。一、环境介绍及说明主库所在的操作系统:win7主库的版本:mysql-5.6.24-winx64.zip主库的ip地址:127.0.0.1主库的端口:3306从库所在的操作系统:win7从库的版本:mysql-5.6.38-winx64.zip从库的ip地址:127.0.0.1从库的端口:3307下载地址:https:/...

weixin_30995917的博客 241
上一篇: mysql 重置root密码
下一篇: C++ 函数返回局部变量地址和引用
最后冰吻free
博客等级 码龄12年 121粉丝 371原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值