MySQL5.7 多实例
时间:2019-05-13 12:00 来源:linux.it.net.cn 作者:IT
1,先按MySQL5.7安装好后
mkdir dbdata_3307
chown mysql:mysql -R dbdata_3307
2,./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/dbdata_3307 -- 1个实例
3,./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/dbdata_3308 --另一个实例
4,启动: mysql -uroot -p -S /tmp/mysql3307.sock
mysql -uroot -p -S /tmp/mysql3308.sock
修改My.cnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[mysqld_multi]
mysqld=/usr/local/mysql/bin/mysqld_safe
mysqladmin =/usr/local/mysql/bin/mysqladmin
user = admin
password = 123
[mysqld3307]
socket = /tmp/mysql3307.sock
port = 3307
pid-file = /usr/local/mysql/dbdata_3307/mysql3307.pid
datadir = /usr/local/mysql/dbdata_3307
basedir = /usr/local/mysql
user = mysql
server-id=3307
[mysqld3308]
socket = /tmp/mysql3308.sock
port = 3308
pid-file =/usr/local/mysql/dbdata_3308/mysql3308.pid
datadir = /usr/local/mysql/dbdata_3308
basedir = /usr/local/mysql
user = mysql
server-id=3308
启动: mysqld_multi start 3307
查看状态:mysqld_multi report 3307
(责任编辑:IT)
1,先按MySQL5.7安装好后 mkdir dbdata_3307 chown mysql:mysql -R dbdata_3307 2,./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/dbdata_3307 -- 1个实例 3,./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/dbdata_3308 --另一个实例 4,启动: mysql -uroot -p -S /tmp/mysql3307.sock mysql -uroot -p -S /tmp/mysql3308.sock 修改My.cnf
启动: mysqld_multi start 3307 查看状态:mysqld_multi report 3307 (责任编辑:IT) |