本文主要给大家简单讲讲MySQL5.7安装及配置MGR教程,相关专业术语大家可以上网查查或者找一些相关书籍补充一下,这里就不涉猎了,我们就直奔主题吧,希望MySQL5.7安装及配置MGR教程这篇文章可以给大家带来一些实际帮助。一、云服务器规划mysql_mgr_01 192.168.10.223mysql_mgr_02 192.168.10.224mysql_mgr_03 192.168.10.225二、配置文件1. mysql_mgr_01[root@mysql_mgr_01 tmp]# cat /etc/my.cnf[mysqld]sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONserver-id=330601port = 3306log_bin = /data/mysql/binlog/mysql_mgr01-bin#expire_logs_days=10explicit_defaults_for_timestamp=truedatadir=/data/mysql/datasocket=/data/mysql/run/mysql.sockskip-external-lockingpid-file=/data/mysql/run/mysql.pidinnodb_file_per_table = on#skip_name_resolve = oncharacter-set-server = utf8mb4character-set-client-handshake = FALSEcollation-server = utf8mb4_unicode_ciinit_connect=’SET NAMES utf8mb4’slow_query_log = onlong_query_time = 2slow_query_log_file = /data/mysql/slow_logs/mysql-slow.logbinlog_rows_query_log_events=ONrelay-log=/data/mysql/relaylog/mysql_mgr_01-relay-bin## Replication configuration parameters#gtid_mode=ONenforce_gtid_consistency=ONmaster_info_repository=TABLErelay_log_info_repository=TABLEbinlog_checksum=NONElog_slave_updates=ONbinlog_format=ROW## Group Replication configuration#transaction_write_set_extraction=XXHASH64loose-group_replication_group_name=”aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa”loose-group_replication_start_on_boot=offloose-group_replication_local_address= “192.168.10.223:24901″loose-group_replication_group_seeds= “192.168.10.223:24901,192.168.10.224:24902,192.168.10.225:24903″loose-group_replication_bootstrap_group=offgroup_replication_member_weight = 100symbolic-links=0[mysqld_safe]log-error=/data/mysql/logs/mysql.logpid-file=/data/mysql/run/mysql.pid[mysql]default-character-set = utf8mb4socket=/data/mysql/run/mysql.sock[client]#default-character-set = utf8mb4socket=/data/mysql/run/mysql.sock2. mysql_mgr_02[root@mysql_mgr_02 tmp]# cat /etc/my.cnf[mysqld]sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONserver-id=330602port = 3306log_bin = /data/mysql/binlog/mysql_mgr02-bin#expire_logs_days=10explicit_defaults_for_timestamp=truedatadir=/data/mysql/datasocket=/data/mysql/run/mysql.soc开发云主机域名kskip-external-lockingpid-file=/data/mysql/run/mysql.pidinnodb_file_per_table = on#skip_name_resolve = onrelay-log=/data/mysql/relaylog/mysql_mgr_02-relay-bincharacter-set-server = utf8mb4character-set-client-handshake = FALSEcollation-server = utf8mb4_unicode_ciinit_connect=’SET NAMES utf8mb4’slow_query_log = onlong_query_time = 2slow_query_log_file = /data/mysql/slow_logs/mysql-slow.logsymbolic-links=0## Replication configuration parameters#gtid_mode=ONenforce_gtid_consistency=ONmaster_info_repository=TABLErelay_log_info_repository=TABLEbinlog_checksum=NONElog_slave_updates=ONbinlog_format=ROW## Group Replication configuration#transaction_write_set_extraction=XXHASH64loose-group_replication_group_name=”aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa”loose-group_replication_start_on_boot=offloose-group_replication_local_address= “192.168.10.224:24902″loose-group_replication_group_seeds= “192.168.10.223:24901,192.168.10.224:24902,192.168.10.225:24903″loose-group_replication_bootstrap_group=offgroup_replication_member_weight = 80[mysqld_safe]log-error=/data/mysql/logs/mysql.logpid-file=/data/mysql/run/mysql.pid[mysql]default-character-set = utf8mb4socket=/data/mysql/run/mysql.sock[client]#default-character-set = utf8mb4socket=/data/mysql/run/mysql.sock3. mysql_mgr_03[root@mysql_mgr_03 tmp]# cat /etc/my.cnf[mysqld]sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONserver-id=330603port = 3306log_bin = /data/mysql/binlog/mysql_mgr03-bin#expire_logs_days=10explicit_defaults_for_timestamp=truedatadir=/data/mysql/datasocket=/data/mysql/run/mysql.sockskip-external-lockingpid-file=/data/mysql/run/mysql.pidinnodb_file_per_table = on#skip_name_resolve = onrelay-log=/data/mysql/relaylog/mysql_mgr_03-relay-bincharacter-set-server = utf8mb4character-set-client-handshake = FALSEcollation-server = utf8mb4_unicode_ciinit_connect=’SET NAMES utf8mb4’slow_query_log = onlong_query_time = 2slow_query_log_file = /data/mysql/slow_logs/mysql-slow.logsymbolic-links=0## Replication configuration parameters#gtid_mode=ONenforce_gtid_consistency=ONmaster_info_repository=TABLErelay_log_info_repository=TABLEbinlog_checksum=NONElog_slave_updates=ONbinlog_format=ROW## Group Replication configuration#transaction_write_set_extraction=XXHASH64loose-group_replication_group_name=”aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa”loose-group_replication_start_on_boot=offloose-group_replication_local_address= “192.168.10.225:24903″loose-group_replication_group_seeds= “192.168.10.223:24901,192.168.10.224:24902,192.168.10.225:24903″loose-group_replication_bootstrap_group=offgroup_replication_member_weight = 90[mysqld_safe]log-error=/data/mysql/logs/mysql.logpid-file=/data/mysql/run/mysql.pid[mysql]default-character-set = utf8mb4socket=/data/mysql/run/mysql.sock[client]#default-character-set = utf8mb4socket=/data/mysql/run/mysql.sock三、MGR配置1. mysql_mgr_01[mysql_mgr_01]#关闭SQL_LOG_BINSET SQL_LOG_BIN=0;#创建组复制使用的帐号密码CREATE USER rpl_user@’%’ IDENTIFIED BY ‘password’;GRANT REPLICATION SLAVE ON *.* TO rpl_user@’%’;FLUSH PRIVILEGES;#开启SQL_LOG_BINSET SQL_LOG_BIN=1;#安装组复制插件group_replication.soINSTALL PLUGIN group_replication SONAME ‘group_replication.so’;CHANGE MASTER TO MASTER_USER=’rpl_user’, MASTER_PASSWORD=’password’ FOR CHANNEL ‘group_replication_recovery’;#初始化主节点SET GLOBAL group_replication_bootstrap_group=ON;START GROUP_REPLICATION;SET GLOBAL group_replication_bootstrap_group=OFF;#查看组复制成员状态SELECT * FROM performance_schema.replication_group_members;#备份mysqldump -uroot -p –all-databases –master-data=2 –single-transaction>/tmp/all.sql2. mysql_mgr_02[mysql_mgr_02]#恢复备份#安装组复制插件group_replication.soINSTALL PLUGIN group_replication SONAME ‘group_replication.so’;CHANGE MASTER TO MASTER_USER=’rpl_user’, MASTER_PASSWORD=’password’ FOR CHANNEL ‘group_replication_recovery’;#启动组复制START GROUP_REPLICATION;3. mysql_mgr_03[mysql_mgr_03]#恢复备份#安装组复制插件group_replication.soINSTALL PLUGIN group_replication SONAME ‘group_replication.so’;CHANGE MASTER TO MASTER_USER=’rpl_user’, MASTER_PASSWORD=’password’ FOR CHANNEL ‘group_replication_recovery’;#启动组复制START GROUP_REPLICATION;MySQL5.7安装及配置MGR教程就先给大家讲到这里,对于其它相关问题大家想要了解的可以持续关注我们的行业资讯。我们的板块内容每天都会捕捉一些行业新闻及专业知识分享给大家的。
本文主要给大家介绍Mysql数据库管理员密码如何设置问题解析,希望可以给大家补充和更新些知识,如有其它问题需要了解的可以持续在开发云行业资讯里面关注我的更新文章的。一、数据库管理员密码的设置:1、修改数据库管理员本机登录密码(操作系统管理员有权限修改)mysq…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。