CREATE USER X IDENTIFIED BY 'Y';
GRANT ALL PRIVILEGES ON *.* TO 'X'@'%' IDENTIFIED BY 'Y' WITH GRANT OPTION;
FLUSH PRIVILEGES;
* From the shell, try to connect to the server:
mysql -uX -pY
Gutsy result: access is granted:
gutsy:~$ mysql -uX -pY
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.0.45-Debian_1ubuntu3.3-log Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Hardy result: access is denied:
hardy ~$ mysql -uX -pY
ERROR 1045 (28000): Access denied for user 'X'@'localhost' (using password: YES)
A workaround is to create another privilege for 'X'@'localhost' in addition to 'X'@'%'.
Confirmed.
TESTCASE:
* Create a test user from mysql shell:
CREATE USER X IDENTIFIED BY 'Y';
GRANT ALL PRIVILEGES ON *.* TO 'X'@'%' IDENTIFIED BY 'Y' WITH GRANT OPTION;
FLUSH PRIVILEGES;
* From the shell, try to connect to the server:
mysql -uX -pY
Gutsy result: access is granted:
gutsy:~$ mysql -uX -pY Debian_ 1ubuntu3. 3-log Debian etch distribution
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.0.45-
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Hardy result: access is denied:
hardy ~$ mysql -uX -pY
ERROR 1045 (28000): Access denied for user 'X'@'localhost' (using password: YES)
A workaround is to create another privilege for 'X'@'localhost' in addition to 'X'@'%'.