• Ubuntu navicat 连接mysql:access denied for user 'root'@'localhost'


    真是醉了,Ubuntu装了navicat后,准备在桌面建立图标不成,结果直接打开后连接mysql都不行,真坑,奈何远程连接就成,这就尬了,今天终于解决了

    问题

    我也百度了好几个方案,奈何解决不了,最后碰见个厉害的博主,博客写的很清楚:https://blog.csdn.net/weixin_42670402/article/details/82730034

    我就是按照其 三、问题解决过程 做的就解决了,支持原著

    1.打开/etc/mysql/mysql.conf.d/mysqld.cnf

      sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

    2.在其中加入 ‘skip-grant-tables' 保存退出   https://blog.csdn.net/wangguchao/article/details/81780567 此博主写了Vim编辑器的退出方式,在此感谢博主

    3.重启服务 service mysql restart

    4.用管理员密码登录  mysql -udebian-sys-maint -p

    5.输入操作命令 

      use mysql

      update mysql.user set authentication_string=password('新密码') where user='root' and Host ='localhost';

      update user set plugin="mysql_native_password";

      flush privileges;

      quit;

    6.重新打开mysqld.cnf,删除刚才加入的'skip-grant-tables' ,保存退出

    不过我登录的时候不是无密登录的,而是参照的https://blog.csdn.net/qq_39479426/article/details/88771315博主写的,用的系统管理员的密码登录的

    首先打开/etc/mysql/debian.cnf,然后记住密码

    然后 mysql -udebian-sys-maint -p   输入密码登录,再执行以上过程,问题解决

    再次感谢以上的博主的贡献!!!

  • 相关阅读:
    (转)当你输入一个网址,实际会发生什么?
    Word Ladder II
    Jump Game II
    Candy
    [生成树][Uva1395][Slim Span]
    [AC自动机][HDU3065]
    [KMP求最小循环节][HDU3746][Cyclic Nacklace]
    [扩展KMP][HDU3613][Best Reward]
    [Manacher][HDU3613][Best Reward]
    [KMP][HDU3336][Count the string]
  • 原文地址:https://www.cnblogs.com/JadenFK3326/p/Ubuntu.html
Copyright © 2020-2023  润新知