更改/etc/my.cnf
[client] #password = your_password port = 3306 socket = /tmp/mysql.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 socket = /tmp/mysql.sock
/etc/init.d/mysqld restart
/etc/init.d/mysqld status
SUCCESS! MySQL running (7562)
mysql -uegilance
ERROR 1045 (28000): Access denied for user 'egilance'@'localhost' (using password: NO)
即可