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
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值