mysql8 修改用户权限

高版本数据库不能按照grant all privileges on *.* to "root"@"%" identified by "xxxx";去修改用户权限

mysql> grant all privileges on *.* to 'yuan'@'%' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| base               |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
mysql> use mysql;
Database changed
mysql> select User,Host from user;
+------------------+-----------+
| User             | Host      |
+------------------+-----------+
| root             | %         |
| yuan             | %         |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+----------

 

posted @ 2022-01-28 13:41  TIFOSI_Z  阅读(807)  评论(0)    收藏  举报