|
Posted by drblitzkrieg on 04/04/07 08:43
Hi,
A bit of a newbie as far as mysql and php adminning I am; I upgraded
php to version 4.4.6, and mysql to 4.1.22, following the instructions
in the "INSTALL" files of each (I also have the same problem on
another server trying the latest mysql 5.0.*). After this, my php
won't connect to mysql, either with mysql_connect():
Warning: mysql_connect() [function.mysql-connect]: Can't connect to
local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /
var/www/html/test.php on line 4
or with ezMySQL:
(Warning: Error establishing mySQL database connection. Correct user/
password? Correct hostname? Database server running? in /var/www/html/
lib/ez_sql_mysql.php on line 84)
I've checked, and /var/lib/mysql/mysql.sock is there, and I can
connect to the server with the "mysql" client program from the shell
just fine, with the same username, pass, server and database name as
I'm using in the code. And all non-database-related php code works
fine, so MySQL and PHP seem to be working OK independently of each
other; I suspect it's just a php setting somewhere. I'd like to get
more detailed information from the connection failure than the above
messages; is that possible? I set "LogLevel debug" in httpd.conf, and
"log-bin" in /etc/my.cnf, and these in /etc/php.ini:
error_reporting = E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
error_log = /var/log/php.log ;for some reason, it's not writing to
this....
-----
Here is the output of mysql_explain_log:
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
contains: [....]) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: ExampleP, Proxy, Sponge.
at bin/mysql_explain_log line 55
--------
System info:
mysql Ver 14.7 Distrib 4.1.22
PHP Version 4.4.6 (according to phpinfo(), but the "php" binary still
in my path is still 4.3.9)
php configure command: ./configure --with-apxs2=/usr/sbin/apxs --with-
mysql
Apache: 2.0.52 (CentOS)
OS: CentOS release 4.4 (Final)
If phpinfo() output would help, let me know.
Thanks.
--
S
Navigation:
[Reply to this message]
|