mysql单机多实例
[mysqld_multi]
mysqld=/usr/local/mysql/bin/mysqld_safe
mysqladmin=/usr/local/mysql/bin/mysqldadmin
log=/usr/local/mysql/mysqld_multi.log
mysqld=/usr/local/mysql/bin/mysqld_safe
mysqladmin=/usr/local/mysql/bin/mysqldadmin
log=/usr/local/mysql/mysqld_multi.log
[mysqld1]
port=3307
datadir = /data_3307
socket= /tmp/mysql_3307.sock
port=3307
datadir = /data_3307
socket= /tmp/mysql_3307.sock
[mysqld2]
port=3308
datadir = /data_3308
socket= /tmp/mysql_3308.sock
port=3308
datadir = /data_3308
socket= /tmp/mysql_3308.sock
初始化
mysqld --initialize-insecure --datadir=/data_3307
mysqld --initialize-insecure --datadir=/data_3307
mysqld --initialize-insecure --datadir=/data_3308
shell终端命令
mysqld_multi start 1
mysqld_multi report
mysqld_multi stop 1
mysql -S /tmp/mysql_3307.sock
shell终端命令
mysqld_multi start 1
mysqld_multi report
mysqld_multi stop 1
mysql -S /tmp/mysql_3307.sock