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)
-   -   Unable to connect to the database (http://www.howtoforge.com/forums/showthread.php?t=59069)

Wsbs9GC 12th October 2012 16:46

Unable to connect to the database
 
Hello.
First, a bit about my setup:
I followed one of the perfect server guides and all processes are on the same machine.
The Problem:
After a system restart, my ispconfig 3 installation throws the errors:
  • Unable to connect to the database
  • Unable to connect to the database:
Notice the difference of the ending colon between the two. I have checked the information in /usr/local/ispconfig/server/lib/config.inc.php and /usr/local/ispconfig/server/lib/mysql_clientdb.conf as suggested in other threads and that information is correct. I have verified this by trying to log into mysql directly with mysql -u user -p and then pasting in the password in those files above. There are no errors in /var/log/mysql.err nor an entries in /var/log/mysql.log so it appears, at least to me, that a connection is never made to the mysql server. I then did some searching around and in /var/log/ispconfig/cron.log there is
Code:

Found linux image: /boot/vmlinuz-3.2.0-31-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-31-generic-pae
Found linux image: /boot/vmlinuz-3.2.0-23-generic-pae
Found initrd image: /boot/initrd.img-3.2.0-23-generic-pae
Found memtest86+ image: /memtest86+.bin
done
PHP Warning:  mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in /usr/local/ispconfig/server/plugins-available/mysql_clientdb_plugin.inc.php on line 276
PHP Warning:  mysql_error() expects parameter 1 to be resource, boolean given in /usr/local/ispconfig/server/plugins-available/mysql_clientdb_plugin.inc.php on line 278
PHP Warning:  mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in /usr/local/ispconfig/server/plugins-available/mysql_clientdb_plugin.inc.php on line 133
PHP Warning:  mysql_error() expects parameter 1 to be resource, boolean given in /usr/local/ispconfig/server/plugins-available/mysql_clientdb_plugin.inc.php on line 135

Upon checking the file in question, I could not find any place within the file that sets the $clientdb_user and $clientdb_password variables.
What do I need to do to fix this problem and, if you wouldn't mind at least speculating, what caused this issue in the first place? All was working fine until a system restart.

till 12th October 2012 16:52

Please test your mysql server with this command:

mysql -h localhost -u root -p

and then enter the mysql root password from the file /usr/local/ispconfig/server/lib/mysql_clientdb.conf

Wsbs9GC 12th October 2012 17:26

Testing with mysql -h localhost -u root -p and then pasting in the password that is in /usr/local/ispconfig/server/libmysql_clientdb.conf allows me to connect:
Code:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1612
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>


till 12th October 2012 17:46

Pk, then the errors in the log are most likely old and have been fixed already, as the file /usr/local/ispconfig/server/libmysql_clientdb.conf conatins the variables with the passwords that are used in the file /usr/local/ispconfig/server/plugins-available/mysql_clientdb_plugin.inc.php to connect to the server when a client new database is created in ispconfig.

Wsbs9GC 12th October 2012 17:49

They are not old. I've deleted the entries in the log and tried to create a new client database and after the job goes through the queue, I get those errors stated above in the log again, with a current timestamp.

till 12th October 2012 17:52

Do you use any special chars in your mysql password, if yes, change it to use only A-z a-z and numbers and tra again.

Wsbs9GC 12th October 2012 17:54

No special characters. It is an alphanumeric password.

till 12th October 2012 17:57

And you use ispconfig 3.0.4.6 and have not modified any sourcecode or installed any third party plugins or addons in ispconfig?

Wsbs9GC 12th October 2012 18:12

I am using ispconfig 3.0.4.6 (per the html title of the admin pages) and have not modified any sourcecode nor installed any 3rd party plugins or addons.

till 13th October 2012 20:44

According to je error message, the mysql password is empty but you said it is not empty and no files were altered, so maybe a file got corrupted. You should ownload the latest ispconfig again, unpack it and run the update.php script ehich is in he intall folder. Choose to reconfigure services during update.


All times are GMT +2. The time now is 09:24.

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