[root@capitek1 mysql]# mysql -uroot -p -h192.168.125.8
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'capitek1' (using password: YES)
修改/etc/my.cnf client节中的socket,因为登陆mysql server是通过客户端工具:mysql等
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
#socket = /var/lib/mysql/mysql.sock
socket = /mysql/data/mysql/mysql.sock
[root@capitek1 bin]# mysql -uroot -p123456 -hlocalhost #再次登陆ok
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.48-community-log MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-665684/ ,如需转载,请注明出处,否则将追究法律责任。