Methods of payment Abuse

Configuring MySQL in Ubuntu

21.01.2023, 23:42
As mentioned in previous articles, you can install the DBMS from the official repository and the developer's repository. Regardless of this, during installation, the program will ask several questions that will need to be answered. Then we will tell you what and how to answer.

Answering DBMS questions

The first thing the program will ask the user is the root password. You will only need to specify it.
 
And then enter again to confirm:
 
The user reserves the right to leave the password area empty, but in this case MySQL will use Unix authorization to log in when launching the mysql client from the console (in this case you will lose remote access). In the future, this will bring some more inconveniences, so it's better not to do this and immediately set the root password.
 
After that, the program will warn you that MySQL will use a new authorization method. This information can be found in the window that opens:
 
Then the installer will then make a request to install a new authorization method or return the old one. The client libraries for MySQL in Ubuntu are already built with support for the new method, so you can leave it:
 
As soon as the installation is completed, you need to execute the mysql_secure_installation command (it will help protect the MySQL server). If you still set the password at the MySQL installation stage, you can run the command without sudo. If the password has not been set, first of all you need to set the code for the root user.
mysql_secure_installation
Have you entered and set the root password? Next, the team will make a request to enable the MySQL password validation plugin. Do not turn it on if you have no idea what it is and what it is for. In short, the plugin will not allow you to install passwords that are too simple for MySQL users. At this stage, we answer n:
 
Next, the utility will ask if you need to change the root password. Here, too, you can answer n, since you have already set the password earlier:
 
We answer all subsequent questions from the program in the affirmative:
 
Using this configuration principle, you will not be able to use only sudo to connect to mysql from the console. You can try, but you will get an Access Denied error. To connect to MySQL using the console client, enter the root password that was set earlier:
mysql -u root -p
This completes the setup instructions completely.