1. Installing CentOS
Refer to the installation and configuration of CentOS
2. Install MySQL 2.1 Downloads mysql.rpm
Use the following command to download the mysql.rpm file to a local
wget https://dev.mysql.com/get/downloads/mysql-8.0/ mysql-community-server-8.0.11-1.el7.x86_64.rpm
Use the following command to add the RPM to the address source and install
Yum localinstall mysql.rpm
Start MySQL with the following command
Systemctl Start mysqld
Use the following command to check the systemctl status mysqld
Use the following command to set up the MySQL service boot
Systemctl Enable Mysqld
2.2mysql Configuration
2.2.1 Password reset
After MySQL installation is successful, the root account is set to the initial password, you can find the password by the following command.
grep ' Password '/var/log/mysqld.log
log in to MySQL using root, such as the following command
Mysql-u root-p
MySQL will prompt for a password, enter the password found above, after successful login, use the following command to modify the password.
ALTER USER ' root ' @ ' localhost ' identified by ' * '
Note: Passwords need to meet MySQL security policy requirements.
2.2.2 Authorized Telnet
The default root account is not remote login, need authorization, first login mysql
Use the UPDATE statement to change the host field of the user table under the MySQL library , and then refresh the permissions.
Update user set host='%' where user='root';
2.2.3 Authorization
Use the following command to authorize
Grant all privileges the on database to account;
Grant Partial permissions:
Select, insert on database to account;
2.2.4 MySQL configuration file
Cat/etc/my.cnf
Here you can modify the default character set and save the following configuration in MY.CNF.
Character_set_server=utf8
Installing MySQL on the CentOS7