You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
update user set authentication_string=PASSWORD("<new2-password>") where User='<user>';
434
+
flush privileges;
435
+
```
436
+
437
+
## Reset Root Password
438
+
Stop MySQL service
439
+
```
440
+
sudo systemctl stop mysql
441
+
```
442
+
Restart MySQL service without loading grant tables
443
+
```bash
444
+
sudo mysqld_safe --skip-grant-tables &
445
+
```
446
+
The apersand (&) will cause the program to run in the background and `--skip-grant-tables` enables everyone to to connect to the database server without a password and with all privileges granted.
447
+
Login to shell
448
+
```
449
+
mysql -u root
450
+
```
451
+
Set new password for root
452
+
```sql
453
+
ALTERUSER'root'@'localhost' IDENTIFIED BY 'MY_NEW_PASSWORD';
0 commit comments