Results 1 to 4 of 4
  1. #1

    mysql.sock error

    Hi guys,
    Encountered a problem that I'm a bit stuck on, was hoping someone could help. One user is reporting problems being able to access his databases via mysql... He's receiving this error when trying a mysql -u USER -pPASSWORD USER_DBNAME

    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/m
    ysql.sock' (2)

    The strange thing is that I can connect to the database as root, just not when I'm su'd to this user. Also I can su to another user and connect to that user's database, so I believe this problem is isolated to this account.

    I checked permissions and ownership in /var/lib/mysql and it appears to be the same as everything else, and tried a /scripts/fixmysql to no avail. Also, mysql is definitely running.

    /var/lib/mysql/ doesn't show any errors when trying to restart:

    050802 8:33:13 /usr/sbin/mysqld: Normal shutdown

    050802 8:33:13 /usr/sbin/mysqld: Shutdown Complete

    050802 08:33:13 mysqld ended

    050802 08:33:14 mysqld started
    /usr/sbin/mysqld: ready for connections

    Any suggestions you might be able to provide would be greatly appreciated!

  2. #2
    Join Date
    May 2002
    can this user connect to mysql from scripts or from phpmyadmin with same username and password?
    Rustelekom LLC Dedicated server since 2002, RIPE NCC member, LIR, AS51168

  3. #3
    No on the scripts, yes on phpmyadmin... It seems to be a permissions problem for this particular user that is not allowing them to connect. Can anyone tell me where I would look to find out for sure? /var/lib/mysql permissions and ownership look right, is there anywhere else I should be checking?

  4. #4
    Well, it looks like sometimes the simplest solutions are easiest to overlook -- turns out that jailshell was enabled for the user, and after we changed his shell to bash it worked perfectly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts