May 29, 2020 / Nirav S
MySQL is a database management system operated under the Open Source software model. It has become a very popular software package for web application software. Like many web services, MySQL has an administrator-level or root password. The root password allows a user to perform all top-level functions in the database.
If you’ve never set a root password on your MySQL database, you should be able to connect to it. However, this is not a good idea as it means anyone can access your database.
If your database already has a root password, but you lost track of it, this guide will help you reset a Mysql Root password on Linux
Use the following steps to reset a MySQL root password by using the command line interface.
$ sudo /etc/init.d/mysql stop
$ sudo mysqld_safe --skip-grant-tables &
$ sudo mkdir -v /var/run/mysqld && sudo chown mysql /var/run/mysqld
$ mysql -uroot
mysql> use mysql;
$ sudo /etc/init.d/mysql stop
$ sudo /etc/init.d/mysql start
$ mysql -u root -p
Have queries about your AWS project ideas and concepts? Please drop in your project details to discuss with our AWS experts, professionals and consultants.