“Error establishing a database connection” means that there is a problem with the connection to your database
This is a problem with the credentials stored in the wp-config.php file not matching what mysql expects.
Try reviewing the following codex article for some guidance: http://codex.ww.wp.xz.cn/Common_WordPress_Errors#Error_Establishing_Database_Connection
Additionally there are a few steps/questions to help with troubleshooting:
1. Can you confirm that you have a running MySQL instance on the Host server?
2. Do you have any other active WordPress sites currently working in the same server?
3. Can you confirm that your MySQL username and password match what you have in config.sys?
4. Is this database (and its tables) accessible using PhpMyAdmin, or similar?
6. Are you able to connect to a brand new, fresh database on your Host Server?
You may have tried all the above, but it will be useful to confirm first that you have tried them all
Best Regards.
Hi Mateus,
Thanks so much for your help !!!
I had the second site up and running a-c-d.net
Then I changed the site url from WordPress Dashboard to http://www.a-c-d.net since this is the url I want. And now I can’t access the site.
I had similar issues on my first virtual host and learned to redirect from wp-config.php and phpmyadmin.
Problem is those tricks doesn’t work on second virtual host.
This is my second virtual host:
<VirtualHost *:80>
ServerName a-c-d.net
DocumentRoot /var/www/html/a-c-d.net/public_html
</VirtualHost>
<VirtualHost *:80>
ServerName http://www.a-c-d.net
</VirtualHost>
How do I get http://www.a-c-d.net to direct to my site, thank you very much!
ServerName is wrong
ServerName a-c-d.net
ServerAlias www.a-c-d.net
Get rid of the second VirtualHost definition