Hi,
using drupal drupal-4.6.2,
I have a weird problem with mysql connection throught apache.
I can connect through php index.php, but when I try to access it through browser I got the fellowing error
"Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)"
I had the file '/var/lib/mysql/mysql.sock' and can access through mysql command line and php command line fine, but apache failed to get mysql connection via php.
I have 2 questions:
1. Should I put drupal php files in cgi-bin dir or not?
Now I put into publich_html dir, not cgi-bin, is it correct?
2. I did a simply php file to check mysql connection.
<?
$user="nobody";
$password="mypass";
$database="drupal";
$mylocalhost="localhost:3306";
mysql_connect($mylocalhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
mysql_close();
?>
It works ok when I use
$> php chechDB.php
But when I try to connect it through browser(i.e. apache), I can not get connection.
died on "Unable to select database",
phpinfo() showed mysql info ok(see bellow)
I'm really puzzled about what to do, anyone have tips?
thanks,
Fan
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.58
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient