Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
"Error establishing database connection" in subdirectory
I am following this tutorial for three WordPress sites:
The first two were set up with no issues. The third, however, is in a subdirectory. I tested that there is a connection with
mysql -u <DB_USER> -p<DB_PASSWORD> -h <DB_HOST> <DB_NAME>
I also tested that it is reading my wp-config.php by adding
die(“Loading this file now”);
to the top. So it does display that line now.
I also looked at How To Debug the WordPress “Error Establishing Database Connection” https://www.digitalocean.com/community/tutorials/how-to-debug-the-wordpress-error-establishing-database-connection
but none of those suggestions helped.
I am thinking it is perhaps related to the fact that I putting WordPress in a subdirectory: mydomain.com/blog
Maybe some permission issue?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×