在apps用户下执行:
1.创建目录
mkdir -p /apps/binlog/mysql57_3307
mkdir -p /apps/dbdat/mysql57_3307
2.修改参数
cd /apps/conf/mysql
cp mysql57_3306.cnf mysql57_3307.cnf
vim mysql57_3307.cnf
替换
:%s/3306/3307/g
server_id=123456
3.初始化DB
/apps/svr/mysql57/bin/mysqld --defaults-file=/apps/conf/mysql/mysql57_3307.cnf --initialize-insecure --user=apps
4.启动DB
nohup /apps/svr/mysql57/bin/mysqld_safe --defaults-file=/apps/conf/mysql/mysql57_3307.cnf --user=apps &
5.登录db
mysql -uroot --socket=/tmp/mysql3307.sock
6.检查db
show variables like '%port%';