Reset The root MYSQL/ MariaDB Password

  • 0

Reset The root MYSQL/ MariaDB Password

Category : How-to

Get Social!

mysql-logoIf you’ve lost or forgotten the root user password on a MySQL or MariaDB server you’ll want to reset it and leave all the other accounts and data intact. Fortunately it’s possible, but you’ll need access to an SSH account hosting the instance and the ability to stop and start the database service.

Before going any further, make sure your instance of MySQL or MariaDB is shutdown.

Start the server in safe mode and don’t load the table grants and permissions.

Log into the local instance with the root user.

Run the below commands SQL, once connected, and reset your password. Be sure to substitute new-password with the new password for your root account.

Finally, start the SQL server instance and use your new root account password.

 


Leave a Reply