I am following this tutorial for three WordPress sites: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-20-04-with-a-lamp-stack
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?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.