Where is '/var/mysql/mysql.sock'

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
sam452

Where is '/var/mysql/mysql.sock'

Post by sam452 »

I've successfully (I think) installed CMS Made Simple 1.6.5 on my OS X, 10.4.11, machine running apache 1 and php 4 (Just above the minimum requirements). Everything is ready with chmod 777, I believe. After finishing installation, I go to the admin page, but cannot get to log in with this error:

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

OK, I'm actually running MySql on usr/local/ where my Rails apps are able to find it. I see the mysql.sock is here: /tmp/mysql.sock

It seems like an environment variable is needed to be altered, but when I searched through all my cms made simple files for 'var/mysql/mysql.sock' I come up with nothing.

So this is where I am, how can I get cms mades simple to find my mysql port? I've got a database set up called cms and have a user with all privileges called 'cms_user'

What should I do to find my MySql db? I want to test it on my machine before I deploy to a working website, thanx, sam
scooter
New Member
New Member
Posts: 3
Joined: Thu Jun 21, 2007 2:26 pm

Re: Where is '/var/mysql/mysql.sock'

Post by scooter »

Just search /etc/php.ini for mysql.default_sock and set it to this.

mysql.default_socket = /tmp/mysql.sock

:-)

Restart apache 1 and that should do it.

The setting is in PHP not CMSMS.
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am

Re: Where is '/var/mysql/mysql.sock'

Post by fredp »

sam452 wrote: ...
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'
...
What should I do to find my MySql db? I want to test it on my machine before I deploy to a working website, thanx, sam
Hi,

It sounds like there is a config file with the wrong 'socket' variable specified for your client (i.e., PHP app on apache).  Last time I looked, MySQL supported multiple levels of config files: global (in /etc/my.cnf), server specific (in /__Your_MySQL_Install_Dir__/mysql-data-dir/my.cnf), and user specific (~/.my.cnf).   You can also specify a PHP specific MySQL socket in your /etc/php.ini file.  Lot's of places to type the wrong thing.   :)  :)

You might look through your config file(s) and verify that you've configured your client to connect on the same socket as the server handling your cmsms database.

Your config will vary, but here is an excerpt from my /etc/my.cnf (on openSUSE 11.1) where you can see that the client and server are using the same named socket:  

Code: Select all

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

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
...
socket          = /var/lib/mysql/mysql.sock
Hope this helps,
Fred
Last edited by fredp on Sun Sep 13, 2009 11:31 pm, edited 1 time in total.
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
Post Reply

Return to “The Lounge”