在MySQL刚装好两个实例的环境下,两实例启动后再关闭时报错;

[root@edb ~]# /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)'

[root@edb ~]# /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设置密码

[root@edb ~]# mysqladmin  -u root -S /data/3306/mysql.sock password 'beatigirl'

[root@edb ~]# mysqladmin  -u root -S /data/3307/mysql.sock password 'beatigirl'

[root@edb ~]# /data/3306/mysql stop
Stoping MySQL...

[root@edb ~]# /data/3307/mysql stop
Stoping MySQL...

[root@edb~]# netstat -lntup|grep 330