1. Configure the Yum source
Download MySQL Source installation package
shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
# install MySQL source
shell> Yum Localinstall mysql57-community-release-el7-8.noarch.rpm
Check that the MySQL source is installed successfully
" mysql.*-community.* "
2. Install MySQL
shell> Yum Install Mysql-community-server
3. Start the MySQL service
Shell> systemctl Start mysqld
Mysqld Viewing the startup status of MySQL
shell> systemctl status mysqld #状态如下 ↓↓↓↓↓
Mysqld.service-MySQL serverloaded:loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset:disabled) Active:active (running) since five .- .- - Geneva:Panax Notoginseng:Panax NotoginsengCST; 35min agomain PID:2888(mysqld) CGroup:/system.slice/mysqld.service└─2888/usr/sbin/mysqld--daemonize--pid-file=/var/run/mysqld/Mysqld.pid6 Month - Geneva:Panax Notoginseng: $Localhost.localdomain systemd[1]: Starting MySQL Server ... June - Geneva:Panax Notoginseng:Panax NotoginsengLocalhost.localdomain systemd[1]: Started MySQL Server.
4. Boot start
shell> systemctl enable Mysqldshell> Systemctl daemon-reload
5. Modify the root local login password
After the MySQL installation is complete, a default password is generated for root in the/var/log/mysqld.log file. Locate the root default password in the following way, and then log in to MySQL to modify it:
' Temporary password ' /var/log/Mysqld.log
Shell> Mysql-uroot-P
Enter password:? aeq,w;i7cnz
MySQL> ALTER USER'Root'@'localhost'Identified by'mynewpass4!'; or MySQL>SetPassword for 'Root'@'localhost'=password ('mynewpass4!');
Note: The password security check plug-in (Validate_password) is installed by default on the mysql5.7 version.
The default password check policy requires that the password must contain: uppercase and lowercase letters, numbers, and special symbols, and cannot be less than 8 bits in length.
Otherwise you will be prompted for error 1819 (HY000): Your password does not satisfy the current policy requirements error as shown:
Default configuration file path:
Configuration file:/etc/my.cnf log file:/var/log// service startup script:/usr/lib/systemd/system/ Mysqld.service socket file:/var/run/mysqld/mysqld.pid
CentOS 7 Installation MySQL