MySQL List,

This is an issue that I am also pursuing on the PHP list, but since it involved my MySQL my.cnf file, and also use of MySQL sockets, I'm posting here in hopes of finding additional assistance.

To make a long story short, while installing Zend Studio (a PHP IDE), I was getting errors when trying to connect to MySQL. I finally resolved the problem with Zend, but, in my earlier attempts to find a solution, I've munged up my MySQL or PHP settings because I can no longer connect to MySQL from PHP.

To resolve this, I tried to retrace my steps and put everything back the way it was. I also reinstalled MySQL, PHP, and phpMyAdmin from the Ubuntu repositories using apt-get.

Despite these efforts, whatever it is that I've done to mess up my system remains in place.

When I start a PHP script that calls upon MySQL, I get the following error:
Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /web_sites/web/db_fns.php on line 6.

So far as I can remember, the only places I made edits were in /etc/php5/apache2/php.ini, and /etc/mysql/my.cnf.

In /etc/php5/apache2/php.ini, here is what the relevant section looks like now:

- - - - - - - - -
; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysql.default_port = 3306

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
- - - - - - - - -

My understanding of the above is that if the socket variable is left empty, it should go with the MySQL default. I have tried specifying "mysql.default_socket = /var/run/mysqld/mysql.sock" and "mysql.default_socket = /tmp/mysql.sock", but that hasn't helped.

As for /etc/mysql/my.cnf, it says:

- - - - - - - - -
[mysqld]
pid-file    = /var/run/mysqld/mysqld.pid
socket     = /var/run/mysqld/mysql.sock
- - - - - - - - -

I am unsure where to look to diagnose this problem further.

Any advice would be much appreciated.

Thank you.

--
Dave M G

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to