Get the App
SLTechnology News&Howtos  ›  Servers  › 

Mysql5.7 retrieves password

Shulou Source: shulou.com Published: 2022-06-03 02:56:05 09月22日 Update

First contact with the database, after installing mysql5.7 in binary, it is found that the initial password can not be found in the log like yum. ~ so

First, shut down the startup database:

Add a new sentence to my.cnf: skip-grant-tables save exit restart mysql

Users can skip the password by logging in to mysql directly.

Change the password:

In the past, we modified it to use:

Update user set password=password ('mysqlpwd') where user='root'

However, the password field does not exist in version 5.7, so:

Update user set authentication_string=password ('mysqlpwd') where user='root'

Flush privileges

Finally, you can quit.

Tags: Password data database binary field log is in version user Zhongxin contact login Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL macOS Shulou Tech Info OPPO Reno Huawei