Submitted by vincen on Thu, 11/29/2012 - 07:24 Pro Licensee
Hi,
I have problem on my server as I can create some DB adn everything about it from Virtualmin for virtual servers but when customers try to use these DB they always get A database connection error :( What is wrong ? My server is connected to you and you check with DB created in commentsco account (it's a wordpress installation, and wp-config file is correlty setup but when you try to access it at http://commentsapp.co/index.php it gives a database connection !
Thanks,
Vincen
Status:
Closed (fixed)
Comments
Submitted by andreychek on Thu, 11/29/2012 - 08:41 Comment #1
Howdy -- if you look in $HOME/logs/error_log, what errors appear there whenever you try to access the website? There may be a more specific database error located in there.
Submitted by vincen on Thu, 11/29/2012 - 09:01 Pro Licensee Comment #2
Hi Andrey,
Thansk for your answer but unhappy it's not helpful as error_log doesn't contain anything about issue :(
Vincen
Submitted by andreychek on Thu, 11/29/2012 - 09:27 Comment #3
That's pretty unusual -- the error_log for that domain should display any errors the website is generating.
However, we can look into a few other things -- what is the output of the following commands:
grep sock /etc/mysql/my.cnf
ls -l /var/lib/mysql/mysql.sock
ls -l /var/lib/mysql/mysqld.sock
ls -l /var/run/mysqld/mysqld.sock
ls -ld /var/run/mysqld
Some of those may produce a "not found" error, that's okay.
Submitted by Locutus on Thu, 11/29/2012 - 10:20 Comment #4
Just a hunch: Are you maybe using usernames longer than 16 characters for database users? MySQL usernames may be only 16 characters long. Virtualmin will display the MySQL username when you go to the user's details, if it differs from the "main" username.
Submitted by vincen on Thu, 11/29/2012 - 10:33 Pro Licensee Comment #5
First I checked and the new db I created with new login is definitively less than 16 characters ;) Here is result of commands requested:
root@pro:~# grep sock /etc/mysql/my.cnf socket = /var/run/mysqld/mysqld.sock socket = /var/run/mysqld/mysqld.sock socket = /var/run/mysqld/mysqld.sock root@pro:~# ls -l /var/lib/mysql/mysql.sock ls: impossible d'accéder à /var/lib/mysql/mysql.sock: Aucun fichier ou dossier de ce type root@pro:~# ls -l /var/lib/mysql/mysqld.sock ls: impossible d'accéder à /var/lib/mysql/mysqld.sock: Aucun fichier ou dossier de ce type root@pro:~# ls -l /var/run/mysqld/mysqld.sock srwxrwxrwx 1 mysql mysql 0 nov. 15 15:02 /var/run/mysqld/mysqld.sock root@pro:~# ls -ld /var/run/mysqld drwxr-xr-x 2 mysql root 80 nov. 15 15:02 /var/run/mysqld root@pro:~#
Thanks,
Vincen
Submitted by Locutus on Thu, 11/29/2012 - 10:45 Comment #6
Can you double-check the settings in your Wordpress config? MySQL by default listens only on localhost, so when you're using the external IP address of your server, Wordpress wouldn't be able to connect.
If that's okay, you might want to verify that the respective user can access the DB from the command line. In a shell, type:
mysql -u username -p
and enter the password. Then you should be able to list the accessible databases withshow databases;
and select the wordpress one withuse wpdbname;
and then list its tables withshow tables;
(note the semicolons).Submitted by vincen on Mon, 12/03/2012 - 13:18 Pro Licensee Comment #7