First, the local Yum source should be set up, see URL (http://www.cnblogs.com/zj21/p/6223462.html).
Put the MySQL file installation package into the /var/opt folder
[email protected] ~]# Yum install/var/opt/*.*-y
[Email protected] ~]# systemctl restart Mysqld.service
[email protected] ~]# Yum install-y httpd
[email protected] ~]# Yum install-y MySQL
[email protected] ~]# Yum install-y php
[email protected] ~]# Yum install-y php-mysql
[Email protected] ~]# systemctl restart Httpd.service
[Email protected] ~]# Systemctl stop Firewalld.service
[Email protected] ~]# Setenforce 0
[Email protected] ~]# Cd/var/log
[[email protected] log]# cat mysqld.log View Database login password
[[email protected] ~]# mysql-uroot-p Login Database
Enter Password: enter password
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 2
Server version:5.7.16
Copyright (c), Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
mysql> alter user ' root ' @ ' localhost ' identified by ' QQQqqq111 ... '; To modify the database initial password
Query OK, 0 rows Affected (0.00 sec)
Mysql> Select User (); View User
+----------------+
| User () |
+----------------+
| [Email protected] |
+----------------+
1 row in Set (0.01 sec)
mysql> CREATE database Word; Create a database
Query OK, 1 row Affected (0.00 sec)
mysql> create user ' zxb ' @ ' 192.168.100.121 ' identified by ' QQQqqq111 ... '; New User Password
Query OK, 0 rows Affected (0.00 sec)
Mysql> grant all privileges in word.* to ' zxb ' @ ' 192.168.100.137 '; Permissions to the new user Word database
Query OK, 0 rows Affected (0.00 sec)
Mysql>
[[email protected] ~]# chmod o+w/var/www/html-r Write permissions to all users ' HTML folders
Put the WordPress Web site file into the/var/www/html folder
Installation and configuration of MySQL under Centos 7