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.

Mysql socket - help

Discussion in 'General Discussion' started by nabil, May 31, 2008.

  1. nabil

    nabil Registered

    Joined:
    May 31, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Dear all,

    None of my databases is accessable, when I try to open phpmyadmin in WHM I get the following error:
    #2002 - De server reageert niet (or the local MySQL server's socket is not correctly configured)

    I've upgraded mysql to 5 and I'm still getting the same,
    please can anyone help?
     
  2. Amit Deshmukh

    Amit Deshmukh Well-Known Member

    Joined:
    Jul 1, 2007
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    '/tmp/mysql.sock' While this error message can be frustrating, the solution is simple

    When connecting to a MySQL server located on the local system, the mysql client connects thorugh a local file called a socket instead of connecting to the localhost loopback address 127.0.0.1. For the mysql client, the default location of this socket file is /tmp/mysql.sock. However, for a variety of reasons, many MySQL installations place this socket file somewhere else like /var/lib/mysql/mysql.sock.

    While it is possible to make this work by specifying the socket file directly in the mysql client command

    mysql --socket=/var/lib/mysql/mysql.sock ...

    Let us know if the error persist.

    it is painful to type this in every time. If you must do so this way (because you don't have permissions to the file in the solution below), you could create an alias in your shell to make this work (like alias mysql="mysql --socket=/var/lib/mysql/mysql.sock" depending on your shell).

    To make your life easier, you can make a simple change to the MySQL configuration file /etc/my.cnf that will permanently set the socket file used by the mysql client. After making a backup copy of /etc/my.cnf, open it in your favorite editor. The file is divided into sections such as

    [mysqld]
    datadir=/usr/local/mysql/data
    socket=/var/lib/mysql/mysql.sock

    [mysql.server]
    user=mysql
    basedir=/usr/local/mysql


    If there is not currently a section called [client], add one at the bottom of the file and copy the socket= line under the [mysqld] section such as:

    [client]
    socket=/var/lib/mysql/mysql.sock


    If there is already a [client] section in the my.cnf file, add or edit the socket line as appropriate. You won't need to restart your server or any other processes. Subsequent uses of the mysql client will use the proper socket file.
     
    #2 Amit Deshmukh, Jun 1, 2008
    Last edited: Jun 1, 2008
  3. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi, this is what you can do to fix this error:
    Login to WHM, search for the "Change local MySQL root password", reset the password to something random & run "/scripts/mysqlup --force" command.
    This will recompile/reinstall MySQL & fis the issue of PHPMyAdmin. :)
     
  4. bogacaslan

    bogacaslan Registered

    Joined:
    Nov 15, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    backup

    Shall we backup our databases before starting /scripts/mysqlup --force ?
     
  5. Ghulam Yaseen

    Ghulam Yaseen Well-Known Member

    Joined:
    Mar 14, 2008
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Karachi,Pakistan
    Yaseen

    Hello :),

    If you want to change the password from console, please follow these steps
    --> mysqladmin -u root password 'newpassword'
    if you wish to upgrade the mysql then please take a backup of mysql using
    --> cp -r /var/lib/mysql /var/lib/mysql.old
    --> service mysql stop
    --> rm -rf /var/lib/mysql
    --> rm -rf /usr/bin/mysql
    now you may proceed with
    --> /scripts/mysqlup --force
    if you are using the CPANEL server then please use this
    --> /scripts/upcp --force
    At this time, the password is disabled if not then please use this script to disable it or your wish
    --> /usr/bin/mysqld_safe --skip-grant-tables &
    and then login mysql :D
     
Loading...

Share This Page