How do I find out my root MySQL password?

前端 未结 11 1965
不知归路
不知归路 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条回答
  •  梦毁少年i
    2020-12-22 17:58

    There is a simple solution.

    MySql 5.7 comes with anonymous user so you need to reconfigure MySQL server.

    You can do that with this command

    try to find temp pass:

    grep 'temporary password' /var/log/mysqld.log
    

    then:

    sudo mysql_secure_installation
    

    On this link is more info about mysql 5.7

    https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html

提交回复
热议问题