What is the default root pasword for MySQL 5.7

前端 未结 13 1225
梦谈多话
梦谈多话 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:45

    None of these answers worked for me on Ubuntu Server 18.04.1 and MySQL 5.7.23. I spent a bunch of time trying and failing at setting the password and auth plugin manually, finding the password in logs (it's not there), etc.

    The solution is actually super easy:

    sudo mysql_secure_installation
    

    It's really important to do this with sudo. If you try without elevation, you'll be asked for the root password, which you obviously don't have.

提交回复
热议问题