Error establishing a database connection

Some of the problems sometimes arise with Mysql database and WordPress. One problem that sometimes arises is the web displays the error Establish a database connection, this problem usually occurs because we haven’t started yet our mysql-server program, or already started but not run well. The solution is simply to check whether or not our mysql running and try to run it.

To view mysql process id
ps -ax | grep mysql

If this command return you no result, it means your mysql doesn’t run.

To start mysql-server

On FreeBSD enter this command
/usr/local/etc/rc.d/ mysql-server start

On Ubuntu/Centos enter this command
service mysql start

It should solve your problem.

Leave a Reply

Your email address will not be published. Required fields are marked *