The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Just a general observation regarding assistance with mysql.sock problems.

Discussion in 'General Discussion' started by rpage, Aug 10, 2005.

  1. rpage

    rpage Member

    Joined:
    Feb 13, 2002
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    I just wanted to thank everyone for all their suggestions, and yes I read all 132 threads on this forum regarding mysql.sock.

    I have to say, I have been doing this for a long time, even consider myself a pro, and this mysql.sock not found error was kicking my butt. LOL

    Just a note to all the other experts out there. Some of you just need to take a step back and think about how you respond to some of these posts. Do you talk to your clients (customers) that way? I sure hope not.

    I have had this problem once before and the steps I took the last time to correct the issue did not work this time. Like I said, I read all of the post regarding mysql.sock and yes your suggestion may have worked for you, but that doesn't mean it's going to work for everyone else. So please, have a kind heart and don't talk down to the ones asking for help. Even us experts don't know all the answers.

    Here are the problems I was coming across and what it took to get it working again. I hope this will help someone else.

    Here are the error messages from WHM when I tried to restart MySQL:
    /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").

    Here are the message recorded in the /var/lib/mysql/hostname.domainname.com.err file:
    050809 23:49:56 mysqld started
    050809 23:49:56 Warning: Asked for 196608 thread stack, but got 126976
    050809 23:49:56 InnoDB: Started
    050809 23:49:56 /usr/sbin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
    050809 23:49:56 Fatal error: Can't open privilege tables: Can't find file: './my$
    050809 23:49:56 Aborting

    050809 23:49:56 InnoDB: Starting shutdown...
    050809 23:49:58 InnoDB: Shutdown completed
    050809 23:49:58 /usr/sbin/mysqld: Shutdown Complete

    050809 23:49:58 mysqld ended

    Here is part of my /etc/my.cnf file:

    Code:
    [client]
    #password       = your_password
    port            = 3306
    socket          = /var/lib/mysql/mysql.sock
    
    # Here follows entries for some specific programs
    
    # The MySQL server
    [mysqld]
    port            = 3306
    socket          = /var/lib/mysql/mysql.sock
    key_buffer = 16M
    max_allowed_packet = 10M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    myisam_sort_buffer_size = 8M
    My system is RedHat 9 with WHM 10.3.1 cPanel 10.4.0-C160 and I was sure that I was running MySQL 4.0.25-standard-log even though now WHM Service Status (within WHM) and mysql --version (SSH) states that it is 4.1.13-standard-log. WHM tweak settings is still stating 4.0. I will need to investigate this more later. I remember observing it downloading and re-installinstalling 4.0.13 when I did /scripts/mysqlup --force (SSH) for what seemed like the 10th time. Strange.
    Anyways, /scripts/mysqlup --force (SSH) may work for some, but beware. When I did this at first, it inadverntly tried to upgrade mysql to 4.1.13 instead of just re-installing mysql 4.0.25. I could see it downloading and installing 4.1.13 rpms. I went into WHM tweak settings (WHM) and the setting was set at mysql 4.1. I changed it back to mysql 4.0 and did /scripts/mysqlup --force (SSH) again, several times. I apologize if this sounds confusing, as I am a little confused at why my mysql version is coming up as 4.1 instead of 4.0. Plus it is 2:00 in the morning and way past my bed time. Moving on.

    From SSH, I did the /scripts/upcp and /scripts/fixeverything. Did they help? I am not sure, but it didn't hurt anything. I made sure there were no mysql processes running and stopped chkservd with /etc/rc.d/init.d/chkservd stop.
    I made sure that there was not a mysql.sock file anywhere.
    Found something strange. when I did locate mysql.sock it returned
    /var/lib/mysql/mysql.sock and /usr/local/lib/mysql.sock, but when I actually go to those paths, I don't see any mysql.sock files. Maybe someone can explain that one.
    I set up the following symbolic link, ln -s /var/lib/mysql/mysql.sock /tmp/mysql.tmp
    I made sure that the tmp folder permissions were set to 1777.
    I restarted chkservd with /etc/rc.d/init.d/chkservd start.
    I did a Reset Local MySQL Root Password from WHM. Instead of using a blank password like some suggestions, I just picked a different password. I did receive error messages that it could not change the password at first but then finished by stating that the password was changed and mysql had started. I apologize for not copying the exact messages. Well, MySQL had not started. I went back into SSH and found that my symbolic link was gone. I created the symbolic link again. Went back into WHM and Reset the Local Mysql Root Passwod back to what it was before. After what seemed like the 10th time, there were no error messages and MySQL did infact actually start. It was great to see the SUCCESSFULL message.

    Why does it matter if you do it one time or ten times? I don't know. But from my experiences with WHM/cPanel, everything doesn't work the way you would expect it to the first time.

    Almost forgot, If you are trying to find the mysql.sock file and your mysql server is not running, you should not be able to find it. If you do, remove it. all you should have is the symbolic link to /var/lib/mysql/mysql.sock in the /tmp folder. When you do get the mysql server running, it will create the mysql.sock file for you.

    I know that my thread is long and that this topic has been beaten to death, but hopefully it will help someone.

    Rick

    PS. Just wanted to add this note. I figured out what all the confusion was about. While I was trying to repair mysql 4.0 and get it up and running, a tech at ThePlanet was also trying to get it back up and running but with 4.1. So I guess we will never truely know what got mine back up working... Rather if it was the multiple stopping mysql and chkservd, creating link, and changing the password, what the tech at ThePlanet was doing or a combination of both.
     
    #1 rpage, Aug 10, 2005
    Last edited: Aug 10, 2005
Loading...

Share This Page