May 29, 2020 / Nirav Shah
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
Also read: How Enable Username & Password Authentication for Linux EC2
As a Director of Eternal Web Private Ltd an AWS consulting partner company, Nirav is responsible for its operations. AWS, cloud-computing and digital transformation are some of his favorite topics to talk about. His key focus is to help enterprises adopt technology, to solve their business problem with the right cloud solutions.
Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.