我创建一个 MySQL 用户如下:
mysql> grant all privileges on *.* to mysql@'%' IDENTIFIED by 'myPassword' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)
mysql> exit;
Bye
然后我尝试使用新创建的用户登录,但它不起作用。
% mysql -u mysql -pmyPassword
ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: YES)
%
为什么?