在MySQL刚装好两个实例的环境下,两实例启动后再关闭时报错;
[[email protected] ~]# /data/3307/mysql stop
Stoping MySQL...
Enter password:
/application/mysql/bin/mysqladmin: connect to server at ‘localhost‘ failed
error: ‘Access denied for user ‘root‘@‘localhost‘ (using password: YES)‘
[[email protected] ~]# /data/3306/mysql stop
Stoping MySQL...
Enter password:
/application/mysql/bin/mysqladmin: connect to server at ‘localhost‘ failed
error: ‘Access denied for user ‘root‘@‘localhost‘ (using password: YES)‘
解决方法:
为root设置密码
[[email protected] ~]# mysqladmin -u root -S /data/3306/mysql.sock password ‘beatigirl‘
[[email protected] ~]# mysqladmin -u root -S /data/3307/mysql.sock password ‘beatigirl‘
[[email protected] ~]# /data/3306/mysql stop
Stoping MySQL...
[[email protected] ~]# /data/3307/mysql stop
Stoping MySQL...
[[email protected]~]# netstat -lntup|grep 330