

You will be prompted to enter the root password you have previously set when the mysql_secure_installation script was run. Otherwise, if you selected the legacy authentication method to log in type: mysql -u root -p If you selected the default authentication method to log in to the MySQL server as the root user type: sudo mysql To interact with MySQL through the terminal, use the mysql client which is installed as a dependency of the MySQL server package. You should answer “Y” (yes) to all questions. Once you set the root password the script will also ask you to remove the anonymous user, restrict root user access to the local machine and remove the test database. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Made so far will take effect immediately. Reloading the privilege tables will ensure that all changes

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y This is also intended only for testing,Īnd should be removed before moving into a production This ensures that someone cannot guess atĭisallow root login remotely? (Press y|Y for Yes, any other key for No) : yīy default, MySQL comes with a database named 'test' thatĪnyone can access. Normally, root should only be allowed to connect from Remove anonymous users? (Press y|Y for Yes, any other key for No) : y You should remove them before moving into a production Testing, and to make the installation go a bit smoother. By default, a MySQL installation has an anonymous user,Īllowing anyone to log into MySQL without having to haveĪ user account created for them. On the next prompt, you will be asked to set a password for the MySQL root user. Press ENTER if you don’t want to set up the validate password plugin. There are three levels of password validation policy, low, medium and strong. Which is used to test the strength of the MySQL users passwords. You will be asked to configure the VALIDATE PASSWORD PLUGIN Would you like to setup VALIDATE PASSWORD component? It checks the strength of passwordĪnd allows the users to set only those passwords which are

VALIDATE PASSWORD COMPONENT can be used to test passwordsĪnd improve security. Run the mysql_secure_installation command to set the root password and to improve the security of the MySQL installation: sudo mysql_secure_installation Securing the MySQL server deployment.Ĭonnecting to MySQL using a blank password. Loaded: loaded (/lib/systemd/system/rvice enabled vendor preset: enĪctive: active (running) since Fri 13:23:25 PDT 37s ago Once the installation is completed, the MySQL service will start automatically, you can verify it by typing: sudo systemctl status mysql
