MySQL – reset the root password
If you have forgotten the root password or another user database is a very simple way to reset it. All commands made from the root of the operating system.
For starters turn off the MySQL server:
1 | /etc/init.d/mysql stop |
Run in the background database server command:
1 | mysqld_safe --skip-grant-tables --skip-networking & |
We log on as root to the mysql database without a password:
1 | mysql -uroot mysql |
Then, in a mysql console:
1 2 3 | mysql> update user set Password=PASSWORD('nasze_nowe_hasło') WHERE User='root'; Query OK, 4 rows affected (0.00 sec) Rows matched: 4 Changed: 4 Warnings: 0 |
1 2 | mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) |
1 2 | mysql> quit; Bye |
We resume the process from the background fg command, and when prompted:
1 | mysqld_safe --skip-grant-tables --skip-networking |
we use the CTRL + C, should appear:
1 | ^C130504 21:32:04 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended |
Run in normal mode, the MySQL server:
1 | /etc/init.d/mysql start |
Finally, you can check the password reset:
1 | mysql -uroot -p |
Related entries:
Deleting apps installed from the Snap store
gconf-service gconf-service-backend gconf2-common libappindicator1 libc++1 libc++1-9 libc++abi1-9 libdbusmenu-gtk4 libgail-common libgail18 libgconf-2-4 libgtk2.0-0 libgtk2.0-bin libgtk2.0-commonAll-in-one voice and text chat for gamers
All-in-one voice and text chat for gamers that's free 20.04
Installation of Redis server in Debian 11
Run SFTP without shell access on Ubuntu 20.04
Applies a transparent background





