当前位置:网站首页>【Ubuntu-MySQL8安装与主从复制】
【Ubuntu-MySQL8安装与主从复制】
2022-06-30 09:32:00 【浅浅望】
文章目录
一、安装
1.1 linux通用版安装
Linux安装MySQL8.x详细步骤
注:
关于 chkconfig --add mysql ,服务 mysql 不支持 chkconfig 的解决方法
Ubuntu下安装sysv-rc-conf报错:“E: Unable to locate package sysv-rc-conf“
1.2 apt 安装
05-ubuntu安装mysql8
Ubuntu 18.04 apt安装MySQL8.0
mysql 使用apt安装成功后:
1.2.1 设置mysql服务开机自启
systemctl enable mysql
1.2.2 授权mysql远程连接
二、主从复制
主库【ubuntu18.04 mysql8.0.29】
从库【windows mysql8.0.26】
2.1 主库
2.1.1 主库配置
文件路径:/etc/mysql/mysql.conf.d/mysqld.cnf
添加配置项:
[mysqld]
log-bin = mysql-bin #[必须]启用二进制日志
server-id = 1
2.1.2 为从库创建账户
注:mysql版本不一致,语句稍微有所不同,此处为mysql8.0.29
CREATE USER 'slave'@'%' IDENTIFIED WITH 'mysql_native_password' BY '123456';
GRANT REPLICATION SLAVE ON *.* TO 'slave'@'%';
上面指令创建一个用户slave,密码为123456,并赋予复制权限。
2.2 从库
2.2.1 从库配置
从库是windows
路径:在mysql安装目录下的my.ini文件
[mysqld]
#[必须]服务器唯一ID
server-id=2
重启mysql服务
2.2.2 修改同步数据库
CHANGE MASTER TO MASTER_HOST='192.168.1.101', #主服务器IP
MASTER_PORT=3306, #主服务器端口
MASTER_USER='user1', #主服务器用户名
MASTER_PASSWORD='userpwd', #主服务器用户密码
MASTER_LOG_FILE='mysql-bin.000001', #日志文件名,获取方法往下看
MASTER_LOG_POS=2235; #也从下面的方法获取
启动SLAVE进程:
start slave;
显示信息:
show slave status\G
边栏推荐
- Reading notes of "Introduction to deep learning: pytoch"
- Cftpconnection:: getfile() download FTP server files and related parameter descriptions
- Esp32 things (V): analysis of common API of esp32 of Swiss Army knife
- Using appbarlayout to realize secondary ceiling function
- Distributed session
- Application of hongruan face recognition
- Properties of string
- Talk about how the kotlin collaboration process establishes structured concurrency
- Esp32 things (I): Preface
- Niuke rearrangement rule taking method
猜你喜欢

Solution to the eighth training competition of 2020 Provincial Games

5. Messager framework and imessager interface

9.JNI_ Necessary optimization design

Opencv learning notes -day13 pixel value statistics calculation of maximum and minimum values, average values and standard deviations (use of minmaxloc() and meanstddev() functions)

Opencv learning notes -day 12 (ROI region extraction and inrange() function operation)
Recommend a very easy-to-use network communication framework HP socket

AutoUpdater. Net client custom update file

Express - static resource request
![[shutter] solve failed assertion: line 5142 POS 12: '_ debugLocked‘: is not true.](/img/77/eb66ec83b34c251e732d495fbaa951.jpg)
[shutter] solve failed assertion: line 5142 POS 12: '_ debugLocked‘: is not true.

Clickhouse installation (quick start)
随机推荐
Duplicate entry '2' for key 'primary appears in JPA‘
Terminal -- Zsh of terminal three swordsmen
AutoUpdater. Net client custom update file
桂林 稳健医疗收购桂林乳胶100%股权 填补乳胶产品线空白
Use of Baidu face recognition API
POJ 1753 flip game (DFS 𞓜 bit operation)
Opencv learning notes-day9 opencv's own color table operation (colormap coloraptypes enumeration data types and applycolormap() pseudo color function)
2021-10-20
Application of hongruan face recognition
Get to know handler again
Esp32 things (x): other functions
Abstract factory pattern
I once met a girl whom I most wanted to take care of all my life. Later... No later
Distributed ID
Numpy (constant)
Niuke walks on the tree (ingenious application of parallel search)
Express file download
So the toolbar can still be used like this? The toolbar uses the most complete parsing. Netizen: finally, you don't have to always customize the title bar!
Opencv learning notes -day 11 (split() channel separation function and merge() channel merge function)
Deep understanding of continuation principle