mysql版本5.7
在my.cnf配置文件中增加下面的配置信息:
[mysqld_multi] #mysqld = /usr/local/mysql/bin/mysqld_safe mysqladmin = /usr/local/mysql/bin/mysqladmin user = root password = 123456 [mysqld3307] server-id=3307 port=3307 log-bin=mysql-bin log-error=/Users/zhja/mysql-cluster/master/mysqld.log tmpdir=/Users/zhja/mysql-cluster/master slow_query_log=on slow_query_log_file =/Users/zhja/mysql-cluster/master/mysql-slow.log long_query_time=1 socket=/Users/zhja/mysql-cluster/master/mysql_3307.sock pid-file=/Users/zhja/mysql-cluster/master/mysql.pid basedir=/Users/zhja/mysql-cluster/master datadir=/Users/zhja/mysql-cluster/master/data [mysqld3308] server-id=3308 port=3308 log-bin=mysql-bin log-error=/Users/zhja/mysql-cluster/slave/mysqld.log tmpdir=/Users/zhja/mysql-cluster/slave slow_query_log=on slow_query_log_file =/Users/zhja/mysql-cluster/slave/mysql-slow.log long_query_time=1 socket=/Users/zhja/mysql-cluster/slave/mysql_3308.sock pid-file=/Users/zhja/mysql-cluster/slave/mysql.pid basedir=/Users/zhja/mysql-cluster/slave datadir=/Users/zhja/mysql-cluster/slave/data read_only=1 执行和查看 killall mysqld mysqld_multi --defaults-extra-file=/etc/my.cnf start mysqld_multi --defaults-file=/etc/my.cnf report 登录实例 mysql -uroot -p -P3308 -h127.0.0.1
点击查看更多内容
3人点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦