简体   繁体   English

如何解决本地主机上的 wordpress 问题 - 建立数据库连接时出错

[英]How to solve wordpress issue on localhost -Error establishing a database connection

I Install wordpress on my local Host after installation complete i work on it for some time after that i shut down my pc and when i turn on my pc and start xampp after that start apache and mysql services and trying to open my wordpress site on local host than its say Error establishing a database connection I Install wordpress on my local Host after installation complete i work on it for some time after that i shut down my pc and when i turn on my pc and start xampp after that start apache and mysql services and trying to open my wordpress site on local主机比它说Error establishing a database connection

After that i check my wordpress database details those details are corect.之后,我检查了我的 wordpress 数据库详细信息,这些详细信息是正确的。

here is code这是代码

    /** The name of the database for WordPress */
define( 'DB_NAME', 'wpdatabase' );

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

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

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

Now i did not understand how to resolve this issue现在我不明白如何解决这个问题

try to repair the db:-尝试修复数据库:-

define('WP_ALLOW_REPAIR', true);

just add this code into wp-config file只需将此代码添加到 wp-config 文件中

okk, so here are very quick steps to run out of this problem:- first make sure your localhost is working fine, just open database by phpmyadmin if db is opening that means you dont have any issue in the connection, 2) check for correct password and username.好的,所以这里有非常快速的步骤来解决这个问题:-首先确保您的本地主机工作正常,如果数据库正在打开,只需通过 phpmyadmin 打开数据库,这意味着您在连接中没有任何问题,2)检查是否正确密码和用户名。 3) Very last step if both above points wont work just go to file directory wp-content/plungins and rename the folder name plugins to pluginsxyz and then check. 3) 如果以上两点都不起作用,则最后一步只是 go 到文件目录 wp-content/plungins 并将文件夹名称 plugins 重命名为 pluginsxyz 然后检查。 I am definatly sure this point will help you我绝对确定这一点会对您有所帮助

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

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