V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
coolair
V2EX  ›  问与答

Linux Mint 18 安装的 MySQL 设置为密码为空以后, apt update 更新了 MySQL,然后使用空密码登陆不上了,怎么处理?

  •  
  •   coolair · 2017-07-21 09:03:35 +08:00 · 991 次点击
    这是一个创建于 2493 天前的主题,其中的信息可能已经有所发展或是发生改变。
    5 条回复    2017-07-21 09:50:45 +08:00
    nullen
        1
    nullen  
       2017-07-21 09:06:08 +08:00
    skip-grant-tables,然后重置密码。
    coolair
        2
    coolair  
    OP
       2017-07-21 09:37:08 +08:00
    @nullen ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
    改了无用啊。
    coolair
        3
    coolair  
    OP
       2017-07-21 09:41:22 +08:00
    UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass')
    WHERE User = 'root' AND Host = 'localhost';
    FLUSH PRIVILEGES;
    执行这条语句,也是无效。
    gotounix
        4
    gotounix  
       2017-07-21 09:47:46 +08:00   ❤️ 1
    update mysql.user set authentication_string=null, plugin="mysql_native_password" where User='root';
    coolair
        5
    coolair  
    OP
       2017-07-21 09:50:45 +08:00
    @gotounix 可以了,多谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2462 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:45 · PVG 21:45 · LAX 06:45 · JFK 09:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.