Click here for "Safe Air Conditioner Repair and Proper Freon Recovery".(Japanese Version)

Ubuntu Server 18.04 ; Installing MySQL

Installing MySQL

1.Install the necessary packages.

2.Configure security settings for MySQL server.

There is a tool called mysql_secure_installtion that can be used to configure security-related settings for the MySQL server.
When you run it, it will ask you a series of questions to help you configure some security settings.

3.Change the configuration so that you can login to MySQL with a password.

I set a password with the above settings, but it will not be used in this way
In MySQL 5.7 and later, the MySQL root user is not allowed to login with a password by default.
Instead of a password, you need to log in with your system's root user (in this case, Ubuntu's root user since the OS is Ubuntu) information.
In other words, you can also login to MySQL as the root user of MySQL with sudo.
This is because MySQL 5.7 or later uses a plugin called auth_socket.
If you want to set a password for the MySQL root user and log in to MySQL with that password as before, you need to change to use the mysql_native_password plugin instead of auth_socket.

If you want to login to MySQL as root user in the future, use the following command
Copied title and URL