无聊那我的阿里云服务器试试MySQL的读写分离
https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/ https://repo.mysql.com//mysql-apt-config_0.8.12-1_all.deb sudo dpkg -i /PATH/version-specific-package-name.deb sudo apt-get update sudo apt-get install mysql-server sudo service mysql status sudo service mysql stop|start 开放外部IP访问: mysql>use mysql; mysql>update user set host = '%' where user ='root'; mysql>flush privileges; mysql>quit sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf bind-address = 127.0.0.1 to bind-address = 0.0.0.0 vi /etc/my.cnf grant replication slave on *.* to 'account'@'183.48.30.200' identified by '123456';
change master to master_host='39.106.107.229',master_user='root',master_password='xxxxx',master_log_file='mysql-bin.000002',master_log_pos=154;
简书博客:
https://www.jianshu.com/p/b0cf461451fb
MySQL授权命令grant的使用方法
https://www.cnblogs.com/crxis/p/7044582.html
虽然对很多配置项不是很明白,但是着实配置成功啦
查看当前主库日志:
show binarylogs
从库检查复制状:
show slave statusg
在主库查看当前链接过来的从库线程:
show processlist
停止复制、从库启动同步