Install MySQL using the latest package manager
Copy
sudo dnf install
@mysql
After the installation is complete, run the following command to start the MySQL service and make it start automatically at startup:
Copy
sudo systemctl enable --now mysqld
To check whether the MySQL server is running, enter:
Copy
sudo systemctl status mysqld
Run the mysql_secure_installation script, which performs some security-related operations and sets the MySQL root password:
Copy
sudo mysql_secure_installation
Proceed as follows:
If you need to set up root account remote login, mysql statement:
Copy
use mysql; update``user``set host='%'``where``user='root'; flush``privileges;
After the setting is complete, open the system's 3306 port:
Copy
sudo firewall-cmd --add-port=3306/tcp --permanent sudo firewall-cmd --reload
MySQL will reversely resolve the dns record of the remote connection address. If the MySQL host cannot connect to the external network, the dns may not be resolved successfully, resulting in a slow connection to MySQL for the first time, so this function can be turned off in the configuration.
Reference Document
Open the /etc/my.cnf
file and add the following configuration:
Copy
[ mysqld]``skip-name-resolve
Copy
sudo systemctl restart mysqld
After the test and installation of this machine, MySQL8.0 is already utf8mb4 character set by default, so the character set will not be modified
Recommended Posts