当前位置:Gxlcms > 数据库问题 > 解决mysql8报错:ERROR 1410 (42000): You are not allowed to create a user with GRANT

解决mysql8报错:ERROR 1410 (42000): You are not allowed to create a user with GRANT

时间:2021-07-01 10:21:17 帮助过:20人阅读

mysql.user set authentication_string=password where user=root;

出现show databases,不能使用。

最后无法只能重新安装mysql 

_____________________

查看MySQL的依赖项:dpkg --list|grep mysql
卸载: sudo apt-get remove mysql-common
卸载:sudo apt-get autoremove --purge mysql-server
清除残留数据:dpkg -l|grep ^rc|awk {print$2}|sudo xargs dpkg -P
再次查看MySQL的剩余依赖项:dpkg --list|grep mysql
继续删除剩余依赖项,如:sudo apt-get autoremove --purge mysql-apt-config
至此已经没有了MySQL的依赖项
再删除目录
sudo rm /var/lib/mysql/ -R # 删除数据库目录
sudo rm /etc/mysql/ -R #删除启动脚本、配置文件等
sudo apt-get autoremove mysql* --purge # 卸载mysql所有文件
sudo apt-get remove apparmor # 这个apparmor是在装mysql-server时装上的,和安全有关

 

_________________________________

 

重新安装后,使用

ALTER user root@localhost IDENTIFIED BY root;  

更改密码。show databases,正常 

#授权所有权限 开启远程连接 GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘; flush privileges; 但是出现另一个错误 

ERROR 1410 (42000): You are not allowed to create a user with GRANT

查询后解决:

update user set host=‘%‘ where user=‘root‘;

再执行两次 Grant all privileges on test.* to ‘test‘@‘%‘; 成功: 但连接Navicat报错 4.修改加密方式: alter user test identified with mysql_native_password by ‘xxx‘; 再试,搞定!     参考:

原文链接:https://blog.csdn.net/qq_34680444/article/details/86238516

 

解决mysql8报错:ERROR 1410 (42000): You are not allowed to create a user with GRANT

标签:有关   data   lib   localhost   csdn   更改   文件   auth   重新安装   

人气教程排行