coolair
V2EX  ›  问与答

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

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