Not only will this command set the root user password, but it will allow you to remove anonymous users, disallow remote root login, and remove the test database. Now, when you log into MySQL, with the command mysql -u root -p, you will be prompted to enter the newly configured password.Īn alternative method for setting the root password for the first time, one that also adds a bit of security to your MySQL database, is to use the mysql_secure_connection command. Where NEWPASSWORD is the password to be used. To do that, open up a terminal window and issue the following command: If, for whatever reason that didn’t happen, you will need to set a password for the first time. Typically, during the installation of MySQL and MariaDB, you are asked to set an initial password. How to set MySQL password for the first timeĭo note, I will refer to MySQL with the idea that everything will work for both MySQL and MariaDB.
0 Comments
Leave a Reply. |