安装前保证firewall和selinux是关闭的以免影响测试
1下载安装包
[[email protected] tools]# cd /tools/
[[email protected] tools]#wget https://cn.wordpress.org/latest-zh_CN.tar.gz
[[email protected] tools]#tar -zxvf latest-zh_CN.tar.gz
[[email protected] tools]# mkdir -p /var/www/html/wordpress
[[email protected] tools]# mv wordpress/* /var/www/html/wordpress
2.配置mysql
创建表库WordPress
[[email protected]]# mysql -uroot -p123456
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)
授权给本机用户WordPress对于库WordPress所有的表,密码为123456
mysql> grant all on wordpress.* to [email protected]'localhost' identified by '123456';
Query OK, 0 rows affected, 1 warning (0.17 sec)
刷新权限
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
查看用户WordPress权限
mysql> select user,host from mysql.user where user='wordpress';
+-----------+-----------+
| user | host |
+-----------+-----------+
| wordpress | localhost |
+-----------+-----------+
1 row in set (0.00 sec)
3.登录网址ip/wordpress进行创建(如果localhost不行需要改为127.0.0.1)
4.配置文件
[[email protected] tools]# cd /var/www/html/wordpress
[[email protected] wordpress]# cp wp-config-sample.php wp-config.php
[[email protected] wordpress]# vim wp-config.php
[[email protected] wordpress]#chmod 777 /var/www/html/wordpress/wp-config.php
[[email protected] wordpress]# vim wp-config.php
/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL数据库用户名 */
define('DB_USER', 'wordpress');
/** MySQL数据库密码 */
define('DB_PASSWORD', '123456');
/** MySQL主机 */
define('DB_HOST', 'localhost');
/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');
/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', '');
[[email protected] wordpress]# systemctl restart httpd
[[email protected] wordpress]# systemctl restart mysqld
一直下一步安装即可
转载于:https://blog.51cto.com/12393216/2378309