Re: Problem with MySql Installation with PHP & Apache on Red Hat Linux 7.3

From: Date: Wed, 09 Apr 2003 16:26:58 +0000
Subject: Re: Problem with MySql Installation with PHP & Apache on Red Hat Linux 7.3
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-10562@lists.php.net to get a copy of this message
On Wednesday, Apr 9, 2003, at 01:48 US/Eastern, Ronald Wiplinger wrote:
joylan@joylanfurtado.com wrote:
I have installed MySql server and database with PHP and a Apache server on a system running Red Hat Linux 7.3. When I try to run mysql, I get the message ERROR 2002 : Can't connect to local MySQL Server through socket '/var/lib/mysql/mysql.sock' (2)
check where my.cnf shows socket = Old place was /var/lib/mysql/mysql.sock New place is /tmp/mysql.sock Change it accordingly and it will work. bye Ronald
Any help would be appreciated. Thanks J. Simon
-- Ronald Wiplinger Consultant, IT department http://www.ortv.com T: +886 (0)2 2533-8082, F: +886 (0)2 2532-6406, M: +886 (0)915 653-452 -- PHP Install Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You should also ensure that the MySQL daemon account's group is the group for your MySQL installation folder. For example, if you installed to /usr/local/mysql, and you have a user mysql running the daemon, you should see the following:
[pbg417:~] barryh% ls -Fla /usr/local/mysql total 0
drwxr-xr-x   12 root    mysql   408 Apr  7 23:33 ./
drwxr-xr-x 12 barryh staff 408 Apr 7 01:45 ../
drwxr-xr-x   36 root    mysql  1224 Apr  7 23:32 bin/
drwxr-xr-x    3 root    mysql   102 Apr  7 02:19 include/
drwxr-xr-x    3 root    mysql   102 Apr  7 23:32 info/
drwxr-xr-x    3 root    mysql   102 Apr  7 02:19 lib/
drwxr-xr-x    3 root    mysql   102 Apr  7 23:32 libexec/
drwxr-xr-x    3 root    mysql   102 Apr  7 02:20 man/
drwxr-xr-x    9 root    mysql   306 Apr  7 23:32 mysql-test/
drwxr-xr-x    3 root    mysql   102 Apr  7 02:19 share/
drwxr-xr-x   29 root    mysql   986 Apr  7 23:32 sql-bench/
drwx------ 116 mysql mysql 3944 Apr 9 10:58 var/ Remember that if your MySQL installation directory is symlinked to a different folder that applying chgrp will not necessarily implement your desired change. For example, my directory /usr/local/mysql is actually a soft link to /usr/local/mysql-3.23.56. You will know this if you execute the ls command above and get something like the following: [pbg417:~] barryh% ls -Fla /usr/local/mysql lrwxr-xr-x 1 barryh staff 13 Apr 7 01:45 /usr/local/mysql@ -> mysql-3.23.56 Also make sure that the mysql user account owns the directory for you data files. The default is [mysql-install-dir]/var. You will notice in the listing above that mysql owns var/. Seven times out of ten the cannot connect error you describe is because mysql hasn't started; the other three times are because you are pointed to the wrong socket or the socket is not world readable 8^) - (see <http://www.mysql.com/doc/en/Can_not_connect_to_server.html> for more info). This is still painfully fresh in my mind since I migrated to a new laptop recently and had forgotten about this problem. Hope that helps, -- Barry C. Hawkins Systems Consultant All Things Computed 404-795-9147 voice/fax barry.hawkins@allthingscomputed.com

« previous php.install (#10562) next »