【命令】Mysql不同版本的授权方式
2022年05月01日 07:24:11 作者:Jiaozn 分类:MySQL 评论(1)MYSQL 5.5和5.7、8.0创建用户和授权的命令分别是?
5.5:
grant all on *.* to ‘user’@’%’ identified by ‘password’;
flush privileges;
5.7:
grant all on *.* to ‘user’@’%’ identified by ‘password’;
flush privileges;
8.0:mysql8.0版本不支持使用 下列命令创建用户,需要先create user,否则报错ERROR 1064
mysql> create user 'test'@'192.168.220.1' identified by 'Liucy0313!';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on *.* to 'test'@'192.168.220.1';
Query OK, 0 rows affected (0.03 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
grant all on *.* to 'username’@’%’ identified by ‘password’;
flush privileges;
除非注明,发表在“Jiaozn的博客”的文章『【命令】Mysql不同版本的授权方式』版权归Jiaozn所有。
转载请注明出处为“本文转载于『Jiaozn的博客』原地址https://jiaozn.com/reed/764.html”
评论
发表评论