标签:dtrace 批量创建 socket local safe link eps flush linux
单机多实例1/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql_data2 出现随机密码 ysDafadvC9%=
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql_data3 出现随机密码 dSrk*yDDy4/:
修改密码
mysql -uroot -p -S /data/mysql/3307/sockt/mysql.sock3307
set password for root@localhost = password(‘P@ssw0rd‘);
use mysql;
update user set host=‘%‘ where user=‘root‘;
flush privileges;
select user,host from mysql.user;
向启动项添加启动文件
cp /usr/local/mysql/support-files/mysqld_multi.server /etc/init.d/mysqld_multi
chmod +x /etc/init.d/mysqld_multi
chkconfig --add mysqld_multi
mysqld_multi start
mysqld_multi report
启动实例
mysqld_multi start 3306
mysqld_multi start 3307
mysqld_multi start 3308
连接实例
mysql -uroot -S /tmp/mysql.sock1 -p
mysql -uroot -S /tmp/mysql.sock2 -p
mysql -uroot -S /tmp/mysql.sock3 -p
set password for 用户名@localhost = password(‘新密码‘);
set password for root@local = password(‘P@ssw0rd‘);
停止实例
mysqladmin -u root -pP@ssw0rd -S /tmp/mysql.sock1 shutdown
mysqladmin -u root -pP@ssw0rd -S /tmp/mysql.sock2 shutdown
mysqladmin -u root -pP@ssw0rd -S /tmp/mysql.sock3 shutdown
netstat -lntup |grep 330
grep log-error mysq3-error.log | tail -100
标签:dtrace 批量创建 socket local safe link eps flush linux
原文地址:https://blog.51cto.com/huxiaoqiu/2539805