GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'abc';
mysql> select user, host, password from mysql.user;
+------+-----------+------------------+
| user | host | password |
+------+-----------+------------------+
| root | localhost | 7b49a39922703c30 |
| root | wengdev01 | |
| root | 127.0.0.1 | |
| | localhost | |
| | wengdev01 | |
| root | % | 7b49a39922703c30 |
+------+-----------+------------------+
6 rows in set (0.00 sec)
DELETE FROM mysql.user WHERE Host <> '%' and user = 'root';
mysql> select user, host, password from mysql.user;
+------+------+------------------+
| user | host | password |
+------+------+------------------+
| root | % | 7b49a39922703c30 |
+------+------+------------------+
1 row in set (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
# 或者delete from mysql.user where password='' or user='';update mysql.user set host='%' where user='root';GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'abc';FLUSH PRIVILEGES;
新建一個用戶,並grant除administration之外的所有權限。
GRANT CREATE,DROP,GRANT OPTION,REFERENCES,EVENT,ALTER,DELETE,INDEX,INSERT,SELECT,UPDATE,LOCK TABLES,TRIGGER,CREATE TEMPORARY TABLES,CREATE VIEW,SHOW VIEW ON *.* TO cs@"%" IDENTIFIED BY 'abc';
作者 jqjyy