例如,你想root使用123456从任何主机连接到mysql数据库的话。
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.03 sec)
来源:oschina
链接:https://my.oschina.net/u/234581/blog/300536