# where is mysql.sock located?



## frustphil (Oct 3, 2009)

I have this error...


> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


I guess this because mysql.sock is not located in /tmp/...
Thanks =)


----------



## dennylin93 (Oct 3, 2009)

First of all, have you started MySQL? If it's already up and running, check /usr/local/etc/my.cnf to see where the socket is located. By default, it is /tmp/mysql.sock.


----------



## frustphil (Oct 3, 2009)

dennylin93 said:
			
		

> First of all, have you started MySQL?


Yup I've started it but if I issue these commmands I get...


> /usr/local/etc/rc.d/mysql-server status
> Nothing, just a blank line
> 
> /usr/local/etc/rc.d/mysql-server rcvar
> ...


Is there something I missed?



			
				dennylin93 said:
			
		

> If it's already up and running, check /usr/local/etc/my.cnf to see where the socket is located. By default, it is /tmp/mysql.sock.



The file is empty...


----------



## DutchDaemon (Oct 3, 2009)

Are you serious? It's sort of jumping off the page there.


```
mysql_enable=NO
```

How about changing that to "YES" and starting MySQL with [cmd=]/usr/local/etc/rc.d/mysql-server start[/cmd]?


----------



## aragon (Oct 3, 2009)

lol

To elaborate, add "mysql_enable=YES" to your /etc/rc.conf.


----------



## frustphil (Oct 3, 2009)

=) Sorry I was so sleepy. It was 3am when I posted my last reply.. Thanks =)


----------



## frustphil (Oct 4, 2009)

I found out that mysql is not running that's why mysql.sock is nowhere to be found. /usr/local/etc/rc.d/mysql-server start does not give affirmation that mysql is running. Also, looks like my problem is similar to this but the solutions there didn't work for me... Any help would be appreciated...


----------



## frustphil (Oct 4, 2009)

Weird, out of curiosity I deinstalled mysql50-server and installed mysql60-server and mysql is now running. I read somewhere that mysql60 is an alpha version, can anyone confirm this pls...


----------



## dennylin93 (Oct 4, 2009)

This is correct. However, MySQL 6.0 isn't under development anymore. See MySQL 6.0 and the MySQL 6.0 Reference Manual.


----------

