LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-12-2005, 03:30 AM   #1
3p0ch
LQ Newbie
 
Registered: Dec 2004
Location: Greece
Distribution: Fedora Core 3
Posts: 28

Rep: Reputation: 15
Mysql socket error


Not sure if this is the right place but anyways...

i get this error when i try to use mysql_connect with php..
Quote:
[client 10.48.97.103] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/mysql.php on line 2
The ip is on a local network, and it is the Apache daemon used ip,... meaning that if i write http://10.48.97.103/ it will open my localhost
 
Old 01-12-2005, 06:19 AM   #2
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Rep: Reputation: 15
Make sure there aren't any problems with your apache or your network settings.

Did you Is your Server running ? ( Check using #ps -ef | grep mysql )
 
Old 01-12-2005, 11:31 AM   #3
3p0ch
LQ Newbie
 
Registered: Dec 2004
Location: Greece
Distribution: Fedora Core 3
Posts: 28

Original Poster
Rep: Reputation: 15
Well.. i didnt use a command to check it out..

I used the services manager of the Fedora Core 3.. and mysqld and apache are up and running..

I can see my mysql through the shell, but the php cant connect..
 
Old 01-14-2005, 07:14 AM   #4
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Rep: Reputation: 15
Ok, your mysqld is running, ok...
Just tell us if you are able to connect to mysqld outside php, using
#mysql -u <user> -password <passwd>
also
try
#mysqladmin -u <user> -password <passwd> ping
or
#mysqladmin -u <user> -password <passwd> status
 
Old 01-14-2005, 07:38 AM   #5
FunkFlex
Member
 
Registered: Jan 2002
Location: UK
Distribution: Redhat 7.2
Posts: 35

Rep: Reputation: 15
make sure you have the php-mysql api installed and working
and also double check it is the correct version for use with your versions of MySQL and PHP
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
error: Can't connect to local MySQL server through socket J0sep Red Hat 20 07-13-2011 09:32 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
mysql - php socket error. ldp Linux - Software 9 10-22-2004 03:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:43 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration