创建数据目录并授权
[root@db01/data/mysql/data]#mkdir /data/3307/data/ /data/3308/data/ -p
[root@db01/data/mysql/data]#chown -R mysql.mysql /data
生成配置文件
[root@db01/data/3308]#cat /data/3307/my.cnf
[mysqld]
user=mysql
basedir=/usr/local/msyql
datadir=/data/3307/data/
port=3307
server_id=3307
log_bin=/data/3307/data/mysql-bin
log_error=/data/3307/data/mysql.log
[mysql]
socket=/tmp/mysql3307.sock
[client]
socket=/tmp/mysql3307.sock
[root@db01/data/3308]#cat /data/3308/my.cnf
[mysqld]
user=mysql
basedir=/usr/local/msyql
datadir=/data/3308/data/
port=3308
server_id=3308
log_bin=/data/3308/data/mysql-bin
log_error=/data/3308/data/mysql.log
[mysql]
socket=/tmp/mysql3308.sock
[client]
socket=/tmp/mysql3308.sock
初始化数据库
[root@db01/data/3308]#mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/3307/data/
[root@db01/data/3308]#mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/3308/data/
启动数据库
[root@db01/data/3308/data]#mysqld_safe --defaults-file=/data/3307/my.cnf &
[root@db01/data/3308/data]#mysqld_safe --defaults-file=/data/3308/my.cnf &
网友评论