Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    407
    Likes Received:
    3
    Trophy Points:
    143
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice