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=16)
-   -   Could not connect to MySQL server! (http://www.howtoforge.com/forums/showthread.php?t=6186)

bruma 13th August 2006 19:13

Could not connect to MySQL server!
 
Hi!

I've changed mysql server passwd (in shell). Then I change/adopt passwd in /home/admispconfig/ispconfig/lib/config.inc.php. But now when I restart ispconfig, I get error:
Quote:

root@madcow:/home/admispconfig# /etc/init.d/ispconfig_server restart
Shutting down ISPConfig system...
/root/ispconfig/httpd/bin/apachectl stop: httpd stopped
ISPConfig system stopped!
Starting ISPConfig system...
/root/ispconfig/httpd/bin/apachectl startssl: httpd started
Could not connect to MySQL server!ISPConfig system is now up and running!
What is wrong? Is there another file that should be updated?
I could normaliy login in mysql ($mysql -u root -p), my mysql passwd cointains just alphanumeric characters.

sjau 13th August 2006 20:40

When you change the mysql password you need to either flush the privileges or restart the mysql server... the same goes if you alter the privileges altogether :)

bruma 13th August 2006 21:36

Yes, I did flush privileges and also restart mysql server.

I'm using ISPConfig 2.2.6. Will reinstall fix that problem? I don't want to lose current configuration and data.

falko 14th August 2006 17:55

Please check your MySQL password in config.inc.php for typos.
Can you connect on the shell with
Code:

mysql -u root -p
using the same password?

bruma 15th August 2006 11:20

Yes, passwd is exactly the same, I also double check for typos in config.inc.php.

sjau 15th August 2006 11:40

can you test this script and tell me the output?

Code:

<?

//Global variables:
$username = ""; // Username for database here
$password = ""; // Password for database here
$db_host = "localhost"; // DB Server
$db_name =  ""; //name of your database here

// Connect to DB
mysql_connect("$db_host","$username","$password")
        or die("Unable to connect to SQL server!");
mysql_select_db("$db_name")
        or die("Unable to select database!");

echo "Connection established to $db_name";

?>


bruma 15th August 2006 12:54

Quote:

Originally Posted by sjau
can you test this script and tell me the output?

Code:

<?

//Global variables:
$username = ""; // Username for database here
$password = ""; // Password for database here
$db_host = "localhost"; // DB Server
$db_name =  ""; //name of your database here

// Connect to DB
mysql_connect("$db_host","$username","$password")
        or die("Unable to connect to SQL server!");
mysql_select_db("$db_name")
        or die("Unable to select database!");

echo "Connection established to $db_name";

?>


This is the output:
Quote:

Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in /home/admispconfig/ispconfig/web/mysqldb.php on line 10
Unable to connect to SQL server!
My server is Ubuntu 6.06. Installed mysql packages:
ii mysql-client 5.0.22-0ubuntu6.06 mysql database client (current version)
ii mysql-client-5.0 5.0.22-0ubuntu6.06 mysql database client binaries
ii mysql-common 5.0.22-0ubuntu6.06 mysql database common files (e.g. /etc/mysql
ii mysql-server 5.0.22-0ubuntu6.06 mysql database server (current version)
ii mysql-server-5.0 5.0.22-0ubuntu6.06 mysql database server binaries

sjau 15th August 2006 12:58

Now this is interesting. Is php actually built with mysql?

Code:

<? phpinfo(); ?>
You should get something like this:

Quote:

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 4.0.24
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient

bruma 15th August 2006 13:17

from <? phpinfo(); ?>:

Quote:

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 4.0.24
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

sjau 15th August 2006 13:38

Maybe this helps: http://www.whoopis.com/howtos/mysql-auth-fix.html

Otherwise here's a goole search with results on that issue:

http://www.google.ch/search?q=Client...en-US:official


All times are GMT +2. The time now is 18:31.

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