How To Reset MySQL root Password

The MySQL root password allows the root user full access to the MySQL database. If you do not remember the root password of the mysql database, you can reset it as follows.

It is necessary to connect with root in Linux environments and with administrator in windows environments to perform these operations.

Reset MySQL root Password

Step 1: Stop MySQL Service

Stop MySQL Server in Ubuntu or Debian:

Stop MySQL Server in CentOS, Fedora, Red Hat Enterprise Linux or Oracle  Enterprise Linux:

Step 2:Start MySQL Without Password

Step 3: Create New MySQL root Password

From mysql cli:

Step 4: Restart MySQL Service

Step 5: Connect To MySQL With New Password

The sample outputs will be as follows:

dbtut
Author: dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *