How do I find out my root MySQL password?

前端 未结 11 1992
不知归路
不知归路 2020-12-22 17:39

I just installed MySQL on Ubuntu and the root user can\'t log in :)

How can I recover or find out my password? Using blank for password does not work.

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-22 17:46

    Under MYSQL 5.7, If you are using mysql for development purpose, just :

    1.kill mysql :

    $ sudo service mysql stop
    

    2.start mysql under --skip-grant-tables mode:

    $ sudo mysqld_safe --skip-grant-tables 
    

    and, further, you could try to change the user table under "skip-grant-table" mode, however I failed.

    so, this is just a workaround.

提交回复
热议问题