coolair
V2EX  ›  问与答

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

  •  
  •   coolair · Jul 21, 2017 · 1361 views
    This topic created in 3219 days ago, the information mentioned may be changed or developed.
    5 replies    2017-07-21 09:50:45 +08:00
    nullen
        1
    nullen  
       Jul 21, 2017
    skip-grant-tables,然后重置密码。
    coolair
        2
    coolair  
    OP
       Jul 21, 2017
    @nullen ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
    改了无用啊。
    coolair
        3
    coolair  
    OP
       Jul 21, 2017
    UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass')
    WHERE User = 'root' AND Host = 'localhost';
    FLUSH PRIVILEGES;
    执行这条语句,也是无效。
    gotounix
        4
    gotounix  
       Jul 21, 2017   ❤️ 1
    update mysql.user set authentication_string=null, plugin="mysql_native_password" where User='root';
    coolair
        5
    coolair  
    OP
       Jul 21, 2017
    @gotounix 可以了,多谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   913 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 21:11 · PVG 05:11 · LAX 14:11 · JFK 17:11
    ♥ Do have faith in what you're doing.