0 votes
1 view
in SQL by (34.6k points)

Can anyone tell me what is the default password of MySQL?

1 Answer

0 votes
by (72.3k points)

In MySQL, by default, the username will be root and there won’t be any password.

If you accidentally kept a password and forgot, here is how to reset the password:

Terminate the MySQL server and restart it with the –skip-grant-tables option.

sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

After that, connect to the MySQL Server using the MySQL client:

 mysql -u root

After that, run this command to reload the grant tables:

FLUSH PRIVILEGES;

Now you can set a new password:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

If you want to learn MySQL from top professionals, then register for this SQL Certification program by Intellipaat.

Also, watch this video on MySQL:

Related questions

0 votes
1 answer
asked Jun 26 in SQL by Sudhir_1997 (34.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...