简体   繁体   English

如何在服务器上基于数据库连接wordpress

[英]How to connent wordpress with a database base on server

I'm newbiee with wordpress , I installed wordpress with a new database where local host as hostname and username as abc123 , database as abc , password as abc according to it . 我是wordpress新手,我用一个新的database安装了wordpress ,新databaselocal hosthostnameusername名为abc123databaseabcpasswordabc

I tried with plugin like wp- business intelligence and cutomizr theme and i generated the tablke using query [wpbusinessintelligence id="1" type ="table"] Details [/wpbusinessintelligence] . 我尝试使用wp-business Intelligence和cutomizr主题之类的插件,并使用查询[wpbusinessintelligence id="1" type ="table"] Details [/wpbusinessintelligence]生成了tablke。

Now my requirement is , I have xyz database and its not in local host its in 167.**.**.** , but when i try to follow the same steps with new folder for new report i get an error message like: 现在我的要求是,我有xyz数据库,它不在167.**.**.**中的本地主机中,但是当我尝试对新报表按照新文件夹的相同步骤操作时,出现一条错误消息,如:

error with database connection 数据库连接错误

May i know where i'm going wrong and what steps should i follow . 我可以知道我要去哪里错了,应该采取什么步骤。

You need to make changes to the wp-config.php file. 您需要对wp-config.php文件进行更改。 This will be in folder that wordpress is installed in on the server. 这将在服务器上安装了wordpress的文件夹中。

There is also a wp-config-sample.php file, in the same folder, in case you make any mistakes and need to start again. 在同一文件夹中还有一个wp-config-sample.php文件,以防万一您犯任何错误并需要重新启动。

In the file there are settings for your database - so that the wordpress installation can communicate with the database ont eh server. 在文件中,有数据库的设置-以便wordpress安装可以与服务器上的数据库通信。 these are the parameters you need to change. 这些是您需要更改的参数。

Below is a copy of the file. 以下是该文件的副本。 You need to change the values in lower case in '' . 您需要在”中以小写形式更改值。 For example, I believe that you should set 例如,我认为您应该设置

define('DB_NAME', 'xyz');

define('DB_USER', 'username_here');  // change  username_here
define('DB_PASSWORD', 'password_here');  // change password_here


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

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

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

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

Then save the file and the database should make the connection and run wordpress. 然后保存文件,数据库应建立连接并运行wordpress。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM