HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   ERROR - Unable to connect to the database (http://www.howtoforge.com/forums/showthread.php?t=54148)

jorizzzz 15th September 2011 19:20

ERROR - Unable to connect to the database
 
Hi guys,

I've managed to break my ispconfig install again... When I want to add a MySQL database to ispconfig for one of my clients, i get the following error message in /var/log/ispconfig/ispconfig.log:

ERROR - Unable to connect to the database

Adding a FTP user works as well..

I've tested the MySQL user and password from /usr/local/ispconfig/server/lib/config.inc.php and they can login to the ispconfig database. What does this error mean? And more important, how can i fix it?

jorizzzz 15th September 2011 20:12

I've got some more errors... When I try to add or remove a database, I see the following error in syslog:
Code:

Sep 15 20:06:01 server1 CRON[6509]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
Sep 15 20:07:01 server1 init: mysql main process (6391) terminated with status 1
Sep 15 20:07:01 server1 init: mysql main process ended, respawning
Sep 15 20:07:01 server1 /etc/mysql/debian-start[6528]: Upgrading MySQL tables if necessary.
Sep 15 20:07:01 server1 /etc/mysql/debian-start[6531]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Sep 15 20:07:01 server1 /etc/mysql/debian-start[6531]: Looking for 'mysql' as: /usr/bin/mysql
Sep 15 20:07:01 server1 /etc/mysql/debian-start[6531]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Sep 15 20:07:01 server1 /etc/mysql/debian-start[6531]: This installation of MySQL is already upgraded to 5.1.41, use --force if you still need to run mysql_upgrade
Sep 15 20:07:01 server1 /etc/mysql/debian-start[6542]: Checking for insecure root accounts.
Sep 15 20:07:01 server1 /etc/mysql/debian-start[6546]: Triggering myisam-recover for all MyISAM tables
Sep 15 20:07:01 server1 CRON[6627]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)

It seems that MySQL is crashing and restarting.. That's not a good thing!

falko 16th September 2011 10:45

You might want to try raising the max_connections parameter in your my.cf file. Restart MySQL afterwards.

jorizzzz 16th September 2011 11:15

Falko,

That option was commented out in my.cnf. I've enabled it and set it to 200. It didn't work :( Same error as before...

falko 17th September 2011 11:22

Is this a physical server or a virtual machine? If you use OpenVZ, what's the output of
Code:

cat /proc/user_beancounters
?

jorizzzz 28th September 2011 09:04

Quote:

Originally Posted by falko (Post 263662)
Is this a physical server or a virtual machine? If you use OpenVZ, what's the output of
Code:

cat /proc/user_beancounters
?

Falco, it's a virtual machine (Ubuntu 11.04). I don't have a user_beancounters in /proc :(

jorizzzz 28th September 2011 09:29

I even tried using the MySQL root username and password in the ISPConfig system. Still the same error :( I was hoping that it was a SQL rights problem, but that wasn't the case :(

jorizzzz 28th September 2011 10:02

Ok, i've found something that might help. I've enabled query logging in MySQL and found the following:

203 Query SELECT * FROM sys_datalog WHERE datalog_id > 507 AND (server_id = 1 OR server_id = 0) ORDER BY datalog_id
204 Connect Access denied for user 'root'@'localhost' (using password: YES)


Is the cron job for creating the databases running with user root?

jorizzzz 28th September 2011 10:31

Ok I fixed the problem! I wasn't aware that you are using the user 'root' to create new databases. I checked the file config.inc.php, but I forgot to take a look at mysql_clientdb.conf.

In short, i changed the MySQL root password, so I had to change it here too. This fixed my problems :)


All times are GMT +2. The time now is 12:10.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.