I always forget to change this setting when attempting to copy/paste somebody else's MySQL config file (my.cnf).
Always locate your original socket setting before overwriting your existing
my.cnf
-- or if you're smart, before creating a new
my.cnf after renaming the old one. I like to
mv the old one to
my.cnf.default, just in case.
For example, this is the proper socket for my dev server:
Code:
socket = /var/run/mysqld/mysqld.sock
I've been trying some tweaked variations of the lowendbox.com MySQL for low-RAM (128MB or less) servers:
Code:
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
skip-innodb
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer = 8M
sort_buffer_size = 8M
[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout
If I run this my.cnf file, I'll get an Error 2002 on the back end. For example, when trying to access MySQL with the
mysql command.
Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Don't see the problem? Look again:
socket = /var/lib/mysql/mysql.sock
socket = /var/run/mysqld/mysqld.sock
Wrong location = MySQL will not start. Oops. --- Don't feel too stupid. I had to Google it, too.
This post, like many others, is a note to self. So much time passes between setting up servers (weeks to months), that I tend to forget some of the easy tasks. In the old days, we kept notebooks. Those were not as easy to search and forums and blogs, however, especially if you power your searches with Google's engine!
If you've come across this post, I hope it's helped you.
And welcome to the site.
__________________
Need a good host? .Find one here:
List of the Best Web Hosts in 2012 - Shared, reseller and VPS hosting