Jump to content


Photo

Configuring Mysql Socket


  • Please log in to reply
3 replies to this topic

#1 Evank6

Evank6
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 07 March 2006 - 02:44 PM

I want to configure my mysql socket in php to /tmp/mysql.sock, i have tried editing it in the php.ini file but i still get the same error. i am using php 4.4.1 on mac os x 1.4.5.0 if it matters. At the moment i cant post much info about it, but i will as soon as i get home from school. thanks.

#2 Evank6

Evank6
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 07 March 2006 - 04:09 PM

Hey, here is the error that i get whenever i try to call my mysql database in php:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Library/WebServer/Documents/News/main.php on line 4[/quote]

the path to my mysql socket is /tmp/mysql.sock not /var/mysql/mysql.sock, i have configured php.ini to say mysql.default_socket = "/tmp/mysql.sock", but it is still trying to use the socket in '/var/mysql/mysql.sock', which doesnt exist.

#3 XenoPhage

XenoPhage
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts

Posted 07 March 2006 - 07:06 PM

[!--quoteo(post=352546:date=Mar 7 2006, 11:09 AM:name=Evank6)--][div class=\'quotetop\']QUOTE(Evank6 @ Mar 7 2006, 11:09 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hey, here is the error that i get whenever i try to call my mysql database in php:
the path to my mysql socket is /tmp/mysql.sock not /var/mysql/mysql.sock, i have configured php.ini to say mysql.default_socket = "/tmp/mysql.sock", but it is still trying to use the socket in '/var/mysql/mysql.sock', which doesnt exist.
[/quote]

Did you restart apache after updating php.ini?
--
[a href=\"http://blog.godshell.com\" target=\"_blank\"]XenoPhage[/a]
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Something mysterious is formed, born in the silent void. Waiting alone and unmoving, it is at once still and yet in constant motion. It is the source of all programs. I do not know its name, so I will call it the Tao of Programming.[/quote]

#4 Evank6

Evank6
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 07 March 2006 - 08:14 PM

not only did i restart apache, i restared the computer it was running on. why i want to edit a variable in php.ini, should i change it to:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]mysql.default_socket = "/tmp/mysql.sock"[/quote]

or

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]mysql.default_socket = /tmp/mysql.sock[/quote]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users