mysql> grant all privileges on *.* to 'root'@'%' identified by 'uid5a827' with grant option; Query OK, 0 rows affected (0.00 sec)
mysql> flush; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'root'@'buy2.w98-e5.ezwebtest.com' identified by 'abcd1234' with grant option; Query OK, 0 rows affected (0.00 sec)
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO
'root'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.10.40.54' IDENTIFIED BY '123456' WITH GRANT OPTION;