然后就是启动多实例:
#查看数据库状态
mysqld_multi --defaults-extra-file=/etc/mysqld_multi.cnf report
[root@lb01 etc]# mysqld_multi --defaults-extra-file=/etc/mysqld_multi.cnf report
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld3 is not running
MySQL server from group: mysqld4 is not running
#启动数据库
[root@lb01 etc]# mysqld_multi --defaults-extra-file=/etc/mysqld_multi.cnf start 2,3,4
[root@lb01 etc]# mysqld_multi --defaults-extra-file=/etc/mysqld_multi.cnf report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld3 is running
MySQL server from group: mysqld4 is running
#停止数据库
[root@lb01 etc]# mysqld_multi --defaults-extra-file=/etc/mysqld_multi.cnf stop 2,3,4
#登陆数据库
mysql -uroot -h127.0.0.1 -P3306
或者指定socket登陆
[root@lb01 etc]# mysql -S /data/3306/mysql.sock
multi 多实例启动工具(2)
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://www.heiqu.com/748496b432102119a10410232088a66e.html