Ralph

MySQL: Reset Root Database User’s Password

Introduction

user

Ralph

Ralph is a car enthusiast, blogger, author and teacher. In addition to being the founder of this website, Ralph is also a Linux Systems Administrator with 9 years+ experience who is also available for freelance or full-time work.


LATEST POSTS

Canvas LMS: Install QTI Migration Tool 08th August, 2017

How To: Add Additional Elastic IPs to AWS EC2 Instances 15th May, 2017

General

MySQL: Reset Root Database User’s Password

Posted on .

Here are the commands you need to execute to change a forgotten MySQL root user password:

Step # 1 : Stop the MySQL service:

# /etc/init.d/mysql stop

Step # 2: Start the MySQL server w/o password:

# mysqld_safe --skip-grant-tables &

Step # 3: Connect to the MySQL server using the MySQL client:

# mysql -u root

Step # 4: Set a new MySQL root user password:

mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> /q

Step # 5: Stop the MySQL server:

# /etc/init.d/mysql stop

Start the MySQL server and test it:

# /etc/init.d/mysql start
# mysql -u root -p
profile

Ralph

Ralph is a car enthusiast, blogger, author and teacher. In addition to being the founder of this website, Ralph is also a Linux Systems Administrator with 9 years+ experience who is also available for freelance or full-time work.

View Comments (0) ...
Navigation