LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 07-19-2007, 07:12 AM   #1
Seanie
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Rep: Reputation: 0
Can't connect '/var/lib/mysql/mysql.sock' (13) but not the usual suspects???


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.
 
Old 07-19-2007, 06:00 PM   #2
Seanie
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Oh yes... extra info on my.cnf

Thanks to Lark at Google Groups for asking about my.cnf

The refs to mysql.sock in my.cnf look OK also

here they are.

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
 
Old 07-22-2007, 03:32 PM   #3
Seanie
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Hi All

Have installed Fedora 7 and these instructions http://www.flmnh.ufl.edu/linux/install_apache.htm

just worked first time.

I'll come bask to Suse again when I understand more

Thanks for your time.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' mohadesz Linux - Server 3 03-15-2008 05:06 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-07-2008 11:48 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) sunlinux Linux - Software 1 11-07-2006 12:08 AM


All times are GMT -5. The time now is 01:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration