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 |
+------------------+----------

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM