WordPress搭建安装

1.下载WordPress到指定文件下
[root@xianxin ~]# cd /soft/code/
[root@xianxin code]# ls
info.php wordpress-5.7.1-zh_CN.tar.gz
2.解压文件
[root@xianxin code]# tar zxf wordpress-5.7.1-zh_CN.tar.gz
3.进入MySQL
[root@xianxin code]# mysql -uroot -ptest(-p后加自己创建数据库的密码)
1.创建数据库并查看

mysql> create database wordpress;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| wordpress          |
+--------------------+
5 rows in set (0.08 sec)

2.配置MySQL接受远程登录连接

mysql> grant all on wordpress.* to 'wpuser'@'localhost' identified by 'password';
Query OK, 0 rows affected, 1 warning (0.01 sec)

3.刷新MySQL的系统权限相关表并退出

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

[root@xianxin code]# cd wordpress
[root@xianxin wordpress]# ls

index.php        wp-admin              wp-content         wp-load.php      wp-signup.php
license.txt      wp-blog-header.php    wp-cron.php        wp-login.php     wp-trackback.php
readme.html      wp-comments-post.php  wp-includes        wp-mail.php      xmlrpc.php
wp-activate.php  wp-config-sample.php  wp-links-opml.php  wp-settings.php

4.复制并修改配置文件
[root@xianxin wordpress]# cp wp-config-sample.php wp-config.php
[root@xianxin wordpress]# vi wp-config.php

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );

/** MySQL database username */
define( 'DB_USER', 'wpuser' );

/** MySQL database password */
define( 'DB_PASSWORD', 'password' );

/** MySQL hostname */
define( 'DB_HOST', '127.0.0.1' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

5.浏览网页并登录
http://192.168.60.78/wordpress
WordPress搭建安装

上一篇:蓝帽杯wp


下一篇:2021红帽杯 wp(持续更新~~)