本文介绍在fedora 25系统通过复制数据目录的方式创建mysql多实例
1.执行命令:
systemctl stop mysqld
2.复制目录:
cp -r mysql mysql-replica01
3.修改文件所有者:
chown -R mysql:mysql mysql-replica01
4.修改配置文件:
[mysqld@replica01]
datadir=/var/lib/mysql-replica01
socket=/var/lib/mysql-replica01/mysql.sock
port=3307
log-error=/var/log/mysqld-replica01.log
5.启动mysqld,登录数据库,生成uuid
6.进入mysql-replica01目录,修改auto.cnf的server-uuid。
7.修改selinux配置
执行命令:setenforce 0
8.执行命令:
systemctl start mysqld@replica01
systemctl enable mysqld@replica01