zoukankan      html  css  js  c++  java
  • 解决mysql8报错:ERROR 1410 (42000): You are not allowed to create a user with GRANT

    新安装Ubuntu20服务版,

    安装mysql8 后

    使用以下语句更改密码

    update 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

  • 相关阅读:
    Oracle.ManagedDataAccess.dll 连接Oracle数据库不需要安装客户端
    Oracle.DataAccess.Client.OracleCommand”的类型初始值设定项引发异常
    SQLAchemy
    MySQL 索引详解大全
    不用任何图片,只用简单的css写出唯美的钟表,就问你行吗?
    Ajax详解
    Mysql自定义函数
    MySQL目录
    Mysql函数集合
    MySQL之扩展(触发器,存储过程等)
  • 原文地址:https://www.cnblogs.com/uge3/p/13166551.html
Copyright © 2011-2022 走看看