当我们新装的mysql,输入创建用户的命令后,提示语法错误,报错如下:
mysql> grant all privileges on *.* to xma@'%' identified by 'myslag123!@#';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'myslag123!@#'' at line 1
因为新版的的mysql版本已经将创建用户和赋予权限的操作分开了,我们可以分两步进行操作。
1.创建用户
mysql> create user 'xma'@'%' identified by 'MySlag123!@#';
Query OK, 0 rows affected (0.01 sec)
2.赋予权限
mysql> grant all privileges on *.* to 'xma'@'%';<br>
Query OK, 0 rows affected (0.00 sec)
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。