[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