创建目录
[root@localhost opt]#mkdir -p /data/330{7,8,9}/data
准备配置文件
[root@localhost opt]# echo '''
[mysqld]
basedir=/opt/mysql
datadir=/data/3307/data
socket=/data/3307/mysql.sock
log_error=/data/3307/mysql.log
log_bin=/data/3307/mysql-bin
server_id=7
port=3307
''' >/data/3307/my.cnf
[root@localhost opt]# echo '''
[mysqld]
basedir=/opt/mysql
datadir=/data/3308/data
socket=/data/3308/mysql.sock
log_error=/data/3308/mysql.log
log_bin=/data/3308/mysql-bin
server_id=8
port=3308
''' >/data/3308/my.cnf
[root@localhost opt]# echo '''
[mysqld]
basedir=/opt/mysql
datadir=/data/3309/data
socket=/data/3309/mysql.sock
log_error=/data/3309/mysql.log
log_bin=/data/3309/mysql-bin
server_id=9
port=3309
''' >/data/3309/my.cnf