Getting “Error establishing a database connection” After Changing WordPress Theme's Files

纵然是瞬间 提交于 2019-12-13 06:20:58

问题


I just changed my WordPress theme's file settings (using WinSCP) and started getting this error. I checked both the site's main address and the wp-admin side. Both are giving me the same basic error. I'm using Google Cloud Compute to host a virtual machine running Apache/Debian with WordPress installed.

Where do I check to make sure these values are correct? I know the DB Password is correct because I can see that in my Google Cloud Console.

But why is it even giving me this error in the first place? Is there some other changes you need to make when you change a theme's information? For reference, I'm using the files from the Zerif Lite theme under a new folder (I'm trying to create my own theme). I'm not 100% sure that I even have a database.


wp-config.php:

Error 1:

Error 2 (wp-admin site):

Virtual Machine's settings:


回答1:


Instead of local host try to pass ip as 127.0.0.1 . If that doesn't work , put your compute engine instance IP in place of that .If these things doesn't solve your problem, go into your wp-config.php and paste above line define('WP_ALLOW_REPAIR', true); and save it. After this run your application again , and see if a repair database option appears . If it does, then click on repair database, and wait for it to get repaired. After the process is complete, remove the WP_ALLOW_REPAIR from wp-config.php file and try running your application again . Hope it works :) .



来源:https://stackoverflow.com/questions/38165493/getting-error-establishing-a-database-connection-after-changing-wordpress-them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!