How to check if MySQL server is working or not? [closed]
I have installed Webuzo on my unmanaged VPS. I am not able to install any applications, since it is giving me errors such "Unable to connect to MySQL server". But through terminal, the MySQL status is running.
Can anybody help how to troubleshoot?
Solution 1:
Many ways to do it - in your terminal:
sudo service mysql status
or
ps aux | grep mysql
What you're facing is probably authentication failure or database misspell.
Did you try logging in with same creds via Terminal?
mysql -u <username> -p <database-name>
Hope it helps :)
Solution 2:
You can check the MySQL service status as follows :
`Root > service mysqld status
or
Root > ps aux | grep mysql
or
// Is MySQL listening to the required port
Root > lsof -i :3306`
You can check the status of the MySQL service from the Webuzo Enduser Panel >> Services Menu. Guide : http://webuzo.com/wiki/Restart_services
As for your error "Unable to connect to MySQL server", are you able to create databases from the Webuzo Enduser Panel ? Guide : http://webuzo.com/wiki/How_to_Create_and_Manage_MySQL_Databases
Did you change the MySQL root users' password ? Password for the MySQL root user is in the file /var/webuzo/my.conf
If the MySQL service is running, try accessing the MySQL server from the terminal.
Hope it helps \m/
Solution 3:
lsof -i :3306 a
and
mysqladmin processlist
Solution 4:
ps uxa | grep mysqld
If there is output, your mysqld is active. (Although it can be yet unreachable, but that will be your next question soon)
Solution 5:
Default MySQL server port is 3306, if it's running then you'll have to check for the right port being used:
# netstat -vulntp |grep -i mysql
If no results returned then you'll have to check your MySQL log.