[root@client ~]# mysql -u root -p php
# create "wordpress" databse (用户名为wordpress,密码为redhat)mysql
MariaDB [(none)]> create database wordpress; sql
Query OK, 1 row affected (0.00 sec)数据库
MariaDB [(none)]> grant all privileges on wordpress.* to wordpress@'localhost' identified by 'redhat'; vim
Query OK, 0 rows affected (0.00 sec)服务器
MariaDB [(none)]> flush privileges; ide
Query OK, 0 rows affected (0.00 sec)wordpress
MariaDB [(none)]> exit 网站
Byeui
[root@client ~]# yum -y install wordpress
[root@client ~]# vim /etc/wordpress/wp-config.php
# line 23: 定义数据库
define('DB_NAME', 'wordpress');
# line 26: 定义数据库用户
define('DB_USER', 'wordpress');
# line 29: 定义数据库密码
define('DB_PASSWORD', 'password');
[root@client ~]# vi /etc/httpd/conf.d/wordpress.conf
# line 8: 添加
Require all granted
[root@client ~]# systemctl restart httpd