Wordpress 安装中的配置

新安装Wordpress 可以参看:Wordpress 网站设计入门1, 安装Wordpress,这个博文介绍的是配置,作为安装的补充。

这个文章也可以用于一个主机安装多个Wordpress 的实现方法。

参看Wordpress 安装手册,有一个option(选项),可以缺省不做,但某种情况下,还是需要的,这是本文的介绍内容。

原文如下:

(Optional) Find and rename wp-config-sample.php to wp-config.php, then edit the file (see Editing wp-config.php) and add your database information.
Note: If you are not comfortable with renaming files, step 3 is optional and you can skip it as the install program will create the wp-config.php file for you.

翻译意思是:

(可选)查找wp-config-sample.php并将其重命名为wp-config.php,然后编辑文件(请参阅编辑wp-config.php)并添加数据库信息。
注意:如果您不喜欢重命名文件,则步骤3是可选的,您可以跳过该步骤,因为安装程序将为您创建wp-config.php文件。

本实验是在本机完成的,解压wordpress 到一个新的目录,命名为wordpressA,这个目录是在www下

数据库准备:新建一个数据库,命名为leon。我是本地windows 下安装的wamp,缺省有mysql。

操作细节可以参看:Wordpress 的删除和重新安装

现在开始按照option 介绍的做

改名WordpressA下文件wp-config.php为 wp-config.php

然后编辑文件内容:

扫描二维码关注公众号,回复: 11608655 查看本文章
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'leon' );

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

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

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

/** 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', '' );

文件内容只是修改了3处,就是数据库名,用户名,密码, 分别是 'leon','root',''

保存文件后,浏览器中打开 http://localhost/wordpressA/ 

下面的内容就和安装wordpress 中内容一致操作了。

这种方法应该也是安装多个wordpress 的方法,用各自不同的数据库。

猜你喜欢

转载自blog.csdn.net/leon_zeng0/article/details/105885754
今日推荐