Resetting MySQL root password when current password is not known

前端 未结 6 1505
情歌与酒
情歌与酒 2020-12-01 10:58

I have inherited a server that has mysql installed on it. I don\'t have the mysql password for any user, not even root (although I have the linux root password). Plus, I a

6条回答
  •  温柔的废话
    2020-12-01 11:26

    For mysql 5.7.16 on Ubuntu 16.04 this worked:

    • login without password:

      sudo mysqld_safe --skip-grant-tables --skip-networking &

    • change password:

      SET PASSWORD FOR 'root'@'localhost' = 'mypass';

    Found solution on MySQL 5.7 Reference Manual

提交回复
热议问题