Set MySQL root password to blank

5
(3)

How to set a blank MySQL root password

In some situations a blank mysql root password is useful, e.g. when providing tests, when multiple database schemes have to be imported, or simply when deploing sql databases are to be provided for tests.

mysql root password

In the terminal, first open MySQL with the root account.

$ sudo mysql

For some MySQL root password configurations, the following command may need to be execute with root password entry.

$ mysql -u root -p

If you need to set an empty password for the root user, this can be created with this command.

MariaDB> SET PASSWORD FOR 'root'@'localhost' = '';

If the password of an existing user is to be set to blank, the following ALTER USER command can be used.

MariaDB> ALTER USER 'user'@'localhost' IDENTIFIED BY '';

The following command creates a new user and will set a blank password.

MariaDB> CREATE USER 'user'@'localhost' IDENTIFIED BY '';

Alternatively, mysqladmin can be used to empty the root password.

$ sudo mysqladmin -u root -pcurrent_password password ''

Note. MySQL can also be managed easily and clearly in the phpMyAdmin graphical web interface.

Conclusion

In this post I show how to set a blank mysql root password can be useful in situations such as when deploying tests when multiple database schemes need to be imported, or simply when sql databases are to be deployed for testing in non-production environments where it should go for simplification without major hurdles.

Wie hilfreich war dieser Beitrag?

Klicke auf die Sterne um zu bewerten!

Durchschnittliche Bewertung 5 / 5. Anzahl Bewertungen: 3

Bisher keine Bewertungen! Sei der Erste, der diesen Beitrag bewertet.

Ein Gedanke zu „Set MySQL root password to blank“

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert