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.

I lose my symlink when I restart mysql

Discussion in 'General Discussion' started by Citizen, Oct 30, 2012.

  1. Citizen

    Citizen Active Member

    Joined:
    Sep 3, 2012
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    A bit ago, I moved my mysql directory from /var/lib/mysql to /home/lib/mysql. In those steps I created a symlink

    ln -s /home/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock

    Which worked great. Today, I had to restart mysql through WHM. When I do, it says it failed and mysql isn't running. Trying again doesn't work. However, if i add the symlink again, it works perfecty, I don't need to do anything else. So now whenever I restart mysql I also have to replace the symlink. Is there a permanent fix that I can do so that I don't have to do this?
     
  2. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    386
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    I am not sure, what made you to choose a symlink for socket? Anyway, the proper way to changemysql socket file location is by editing /etc/my.cnf file. Open my.cnf file, under [mysqld] section add socket=/home/lib/mysql/mysql.sock and restart mysql.
     
  3. Citizen

    Citizen Active Member

    Joined:
    Sep 3, 2012
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I did. That's why this doesnt' make any sense.

    My etc/my.cnf reads:

    [mysqld]
    datadir = /home/lib/mysql
    socket = /home/lib/mysql/mysql.sock
     
Loading...

Share This Page