3 messages in com.mysql.lists.perlRE: Fw: Something weird - I cannot pr...
FromSent OnAttachments
A. Santillan Iturres23 Feb 2001 18:14 
A. Santillan Iturres24 Feb 2001 08:20 
A. Santillan Iturres24 Feb 2001 13:56 
Subject:RE: Fw: Something weird - I cannot print text
From:A. Santillan Iturres (ale@netverk.com.ar)
Date:02/24/2001 01:56:59 PM
List:com.mysql.lists.perl

Elis, what I tried to explain was that after the installation of the new MySQL (a beta version) which comes with the RH7.0 release of linux , the Client only worked if invoked from root (the unix root, as any MySQL user) because of some permission problem on the /var/lib/mysql/mysql.sock which was swrxwrxwrx, that means superuser ownership. I've tried to change permissions as you suggested by doing chmod 1777 /var/run/mysqld and chmod 1777 /var/run/mysql But the result was that now the server cannot be accessed by any unix user, neither root. Don't ask me why. It seems that is better to do what you suggested first, to reinstall the latest MySQL and MySQLClient

MySQL-client-3.23.33-1 and MySQL-3.23.33-1

This should work.

Thanks again!

Hi Elis! Thank you for your answer, it was right. Look at what I found at the apache error logs:

DBI->connect(database=test;host=localhost) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) at /home/httpd/cgi-bin/example.cgi line 11

That is exactly the same error I had received at the time I joined this mailing list :)) And, as I said a little earlier, the problem was solved by installing the latest MySQL (that is 3.23.32-1.7.6x), along with a newer version of mysqlclient (that is mysqlclient9-3.23.22-3.6x).

I know now what's going on. It seems that some permissions have changed. Each successful login to mysql from the command line was made as root, whereas the script is run from another user, which have certain lack of premissions on the mysql.sock. That's the problem.

The MySQL user root has nothing to do with the system user root. It's just another username, might as well be administrator, nobody, or johndoe. The mysql.sock file has a special type. Try looking in the /var/logs/mysqld.log, see if there is an error while trying to write in /var/run/mysqld/mysqld.pid (the paths may differ on different systems, depending on where you installed mysql, but these should be the defaults). If there's an error, try a "chmod 1777 /var/run/mysqld" or "chmod 1777 /var/run/mysql" (chmod is the command for changing permissions on a file/directory, and 1777 should allow everyone to write in the directory, but only modifying files which they were already owners of).

Do you have any idea how this works? Or how I have to change permissions? /var/lib/mysql/mysql.sock is a strange kind of file with the permissions: srwxrwxrwx 1 mysql mysql 0 Feb 23 17:57 mysql.sock -rw-r--r-- 1 mysql mysql 5 Feb 23 17:57 mysqld.pid drwxrwxr-x 2 mysql root 1024 Feb 23 21:28 test

Best regars, Elis. Alejandro Santillan Iturres

I hope it helps... Best regards, Elis.