What is the default root pasword for MySQL 5.7

前端 未结 13 1211
梦谈多话
梦谈多话 2020-12-22 16:55

Cannot login to MySQL database after fresh install with root ID and empty/no password like other older MySQL versions do

13条回答
  •  庸人自扰
    2020-12-22 17:52

    I just installed Linux Mint 19 (based on Ubuntu 18.04) on my machine. I installed MySQL 5.7 from the repo (sudo apt install mysql-server) and surprisingly during installation, the setup didn't prompt to enter root password. As a result I wasn't able to login into MySQL. I googled here and there and tried various answers I found on the net, including the accepted answer above. I uninstalled (purging all dpkgs with mysql in its name) and reinstalled again from the default Linux Mint repositories. NONE works.

    After hours of unproductive works, I decided to reinstall MySQL from the official page. I opened MySQL download page (https://dev.mysql.com/downloads/repo/apt) for apt repo and clicked Download button at the bottom right.

    Next, run it with dpkg:

    sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
    

    At the installation setup, choose the MySQL version that you'd like to install. The default option is 8.0 but I changed it to 5.7. Click OK to quit. After this, you have a new MySQL repo in your Software Sources.

    Update your repo:

    sudo apt update
    

    Finally, install MySQL:

    sudo apt install mysql-server
    

    And now I was prompted to provide root password! Hope it helps for others with this same experience.

提交回复
热议问题