Go Back    Forum > Digital Publishing / Web Sites > Website and Server Troubleshooting

Reply
 
LinkBack Thread Tools
  #1  
01-16-2012, 09:09 AM
kpmedia's Avatar
kpmedia kpmedia is offline
Site Staff | Web Hosting, Photo
 
Join Date: Feb 2004
Posts: 4,311
Thanked 374 Times in 341 Posts
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

- Did my advice help you? Then become a Premium Member and support this site.
- Please Like Us on Facebook | Follow Us on Twitter

- Need a good web host? Ask me for help! Get the shared, VPS, semi-dedicated, cloud, or reseller you need.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
06-06-2012, 03:11 AM
kpmedia's Avatar
kpmedia kpmedia is offline
Site Staff | Web Hosting, Photo
 
Join Date: Feb 2004
Posts: 4,311
Thanked 374 Times in 341 Posts
This can also happen on a new MySQL installation, where:
  1. You are trying to run mysql_secure_installation ...
  2. ... but MySQL is but not yet running! On Fedora, for example, installing a service does not also start it.

Simply CTRL-C out of the mysql_secure_installation, and start MySQL:
Code:
service mysqld start
Now try again. It should work fine.

- Did my advice help you? Then become a Premium Member and support this site.
- Please Like Us on Facebook | Follow Us on Twitter

- Need a good web host? Ask me for help! Get the shared, VPS, semi-dedicated, cloud, or reseller you need.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up FTP to connect to website servers? admin Website and Server Troubleshooting 7 01-02-2024 11:11 PM
MySQL query to disable comments on WordPress posts/pages admin Website and Server Troubleshooting 0 10-02-2011 06:07 PM
Advise about buying a used unit from local dealer? rocko Project Planning, Workflows 1 07-30-2011 05:56 PM
Can I connect my computer to LCD TV? cyber-junkie Videography: Cameras, TVs and Players 15 06-09-2011 01:00 PM
How to use FTP to Connect to a Server lordsmurf Computers 4 07-28-2006 03:39 PM

Thread Tools



 
All times are GMT -5. The time now is 03:29 AM