MySQL 8:ERROR 1410 (42000): You are not allowed to create a user with GRANT解决方法

2023-11-28 0 448

MySQL 8.0是全球最受欢迎的开源数据库的一个非常令人兴奋的新版本,全面改进。一些关键的增强包括:SQL窗口函数,公用表表达式,NOWAIT和SKIP LOCKED,降序索引,分组,正则表达式,字符集,成本模型和直方图等。

1.装了mysql8.0.13,试着分配几个账号和权限,结果报错:

2. 查资料得知mysql8的分配权限不能带密码隐士创建账号了,要先创建账号再设置权限

输入命令:

Grant all privileges on test.* to 'test'@'%';

又报错:

You are not allowed to create a user with GRANT;

不允许使用grant命令,怎么会没权限,奇怪。

3.后来想到了mysql数据表user中的host

于是修改host:

update user set host='%' where user='test';,

再执行两次

Grant all privileges on test.* to ‘test’@’%’; 成功:

但连接Navicat报错

这是因为mysql8的加密方式和Navicat不一样

4.修改加密方式:

alter user test identified with mysql_native_password by 'xxx';

再试,搞定!

本文来源:www.lxlinux.net/8365.html,若引用不当,请联系修改。

相关文章

猜你喜欢
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

  • 0 +

    访问总数

  • 0 +

    会员总数

  • 0 +

    文章总数

  • 0 +

    今日发布

  • 0 +

    本周发布

  • 4975 +

    运行天数

你的前景,远超我们想象