Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Closed Thread
  Search this Thread
Old 11-23-2004, 10:11 AM   #1
LQ Newbie
Registered: Nov 2004
Posts: 13

Rep: Reputation: 0
PHP Problems with Mysql

I just installed PHP and Mysql with apache as usual, I have a problem
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
origiinally my mysql.sock was in /tmp so i created a symbolic link to /var/lib/mysql and still the same error. I've tried everything and the sock file is definately there, but php can't get a connection from it. I try running the mysql client program using the --socket option and that works through either socket so the socket definatley points to the connection.

Does anyone know why this wouldn't work through php when it works through the command line client. PHP is recognising the mysql commands, but just not connecting.

I tried changing the permissions on the file and directory, still no luck. Anyone got any suggestions would be really appreciates

Matt Johnson
Old 11-23-2004, 10:17 AM   #2
Senior Member
Registered: Apr 2004
Location: Surprise, AZ
Distribution: Debian | CentOS | Arch
Posts: 1,103

Rep: Reputation: 45
So you do have the MySQL section of you phpinfo() page?? If you're not getting that.. than you need to edit your PHP config for MySQL..
Old 11-23-2004, 10:45 AM   #3
LQ Newbie
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
I do have a mysql section:

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.58
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient

that looks ok, anyone see anything funny?
Old 11-23-2004, 12:12 PM   #4
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

This your original post, this one is being closed.

Closed Thread

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql-php-apache problems.. khuti2005 Linux - Newbie 4 10-20-2005 04:28 PM
problems in installing php with mysql krunal Linux - Newbie 3 08-18-2005 09:38 AM
Php, mysql, nvidia problems rohmanovich Linux - Software 2 04-01-2005 05:18 AM
PHP Problems with Mysql MattJohnson Linux - Networking 1 11-23-2004 10:19 AM
php and mysql problems punt Linux - Software 9 03-04-2003 10:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:19 AM.

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