What is the default root pasword for MySQL 5.7

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

    MySQL 5.7 or newer generates a default temporary password after fresh install.

    To use MySQL first you would be required to get that password from the log file which is present at the /var/log/mysqld.log. So follow the following process:

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

    2. mysql_secure_installation

    The second command is required to change the password for MySQL and also to make certain other changes like removing temporary databases, allow or disallow remote access to root user, delete anonymous users etc…

提交回复
热议问题