MySQL 5.7 创建多个实例 基于CentOS 7

MySQL 5.7 创建多个实例 基于CentOS 7
修改配置文件/etc/my.cnf
[mysqld@db01]
datadir=/var/lib/mysql-replica01
socket=/var/lib/mysql-replica01/mysql.sock
port=3307
log-error=/var/log/mysqld-replica01.log

[mysqld@db02]
datadir=/var/lib/mysql-replica02
socket=/var/lib/mysql-replica02/mysql.sock
port=3308
log-error=/var/log/mysqld-replica02.log

启用服务

systemctl enable mysqld@db01
systemctl enable mysqld@db02

开启实例

systemctl start mysqld@db01
systemctl start mysqld@db01

删除服务

systemctl disable mysqld@db01
systemctl disable mysqld@db01

管理实例

mysql -S  /var/lib/mysql-replica01/mysql.sock -uroot -p

mysql -S  /var/lib/mysql-replica02/mysql.sock -uroot -p

MySQL 5.7 创建多个实例 基于CentOS 7

上一篇:Prometheus、Alertmanager、Grafana 监控 Linux 与 MySQL


下一篇:oracle 查看表空间