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>';
375
432
flush privileges;
376
433
```
377
434
435
+
## Reset Root Password
436
+
Stop MySQL service
437
+
```
438
+
sudo systemctl stop mysql
439
+
```
440
+
Restart MySQL service without loading grant tables
441
+
```bash
442
+
sudo mysqld_safe --skip-grant-tables &
443
+
```
444
+
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.
445
+
Login to shell
446
+
```
447
+
mysql -u root
448
+
```
449
+
Set new password for root
450
+
```sql
451
+
ALTERUSER'root'@'localhost' IDENTIFIED BY 'MY_NEW_PASSWORD';
0 commit comments