Hello All
I'm new to Linux and am trying to learn to develop PHP and MySQL web applications but am stuck.
I'm running Suse 10.0 and have installed Apache, PHP and MySQL from the DVD.
Apache, and PHP are working and
<?php phpinfo(); ?> produces the expected output.
MySQL is also working and I've used knoda to create a sample database.
I'm using this php code to try to connect to MySQL
...
$mysqluser = 'root';
$mysqlpasswd = 'mypassword123';
$mysqlhost = 'localhost';
$connID = mysql_connect($mysqlhost, $mysqluser, $mysqlpasswd);
...
However, when I try it I get:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) .
I've been searching the posts and understand that (13) means it is a permissions problem. However all the reported causes I can find seem OK on my machine.
1) MySQL is running
I've checked with mysqladmin ping and get the following
linux:~ # mysqladmin -p ping
Enter password:
mysqld is alive
linux:~ #
2) SELinux is disabled (although I am confused on this point as I'm using Suse 10.0 and some posts say it is SELinux unsupported in Suse 10.0)
Anyhow, I used
usr/sbin/setenforce Permissive
and now
/usr/sbin/getenforce
says
'Disabled'
3) mysql.sock is where I'd expect it to be, with the expected mysql owner, mysql group and expected permissions. I tested this like so.
linux:~ # ls -l /var/lib/mysql/mysql.sock
srwxrwxrwx 1 mysql mysql 0 Jul 15 13:54 /var/lib/mysql/mysql.sock
linux:~ #
4) /var/lib/mysql/ has the expected mysql owner, mysql group and expected permissions. I tested this like so.
linux:~ # ls -l /var/lib/
......(I'm omitting some lines here)
drwxrwxrwx 7 mysql mysql 520 Jul 15 13:54 mysql
......(I'm omitting some lines here)
linux:~ #
6) I included myself in the mysql group.
Clearly, I am missing something but I don't know what.
My guess is it is something silly and simple, but it beats me.
Any help anyone can give would be greatly appreciated.