Get the App
SLTechnology News&Howtos  ›  Database  › 

The solution to the disappearance of mysql database caused by an error in modifying root in mysql

Shulou Source: shulou.com Published: 2022-06-01 13:49:24 11月12日 Update

An error occurred while updating the ROOT password today

Update user set password='123456' where user = "root" is wrong to write like this

Should be update user set password = password ('123456') where user = "root"

After the wrong operation, the mysql database disappeared.

Solution:

Close / etc/init.d/mysqld stop

Then, usr/bin/mysqld_safe-- skip-grant-tables

Start / etc/init.d/mysqld start

Mysql-u root

Mysql > use mysql

Mysql > UPDATE user SET Password=PASSWORD ('xxx') WHERE user='root'

Tags: Data database method password error update Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Information MariaDB Docker Apple