[oracle@db ~]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1054
Server version: 5.0.77-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> grant all privileges on justin.* to justin_user@"%" identified by 'justin_user';
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'justin'
退出 重新登录
[oracle@db ~]$ mysql -u root -p -h db
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1055
Server version: 5.0.77-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> grant all privileges on justin.* to justin_user@"%" identified by 'justin_user';
Query OK, 0 rows affected (0.07 sec)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15480802/viewspace-687284/ ,如需转载,请注明出处,否则将追究法律责任。