Plesk

Unable to log into Plesk: Unable to connect to database: mysql_connect(): Permission denied /var/lib/mysql/mysql.sock

Applicable to:

  • Plesk for Linux

Symptoms

Cause

Incorrect permissions for
/var/lib/mysql/
directory and its subdirectories.

Resolution

  1. Log in to the server via SSH;

    Note: if direct SSH access to the server is not possible, contact server administrator for further assistance.

  2. Set proper owner to the directory and files:

    # chown -R mysql:mysql /var/lib/mysql
    # find /var/lib/mysql/* -type d -exec chmod 0700 {} ;
    # find /var/lib/mysql/* -type f -exec chmod 0660 {} ;

    For Debian/Ubuntu

    # chmod 700 /var/lib/mysql

    For RHEL/CentOS

    # chmod 755 /var/lib/mysql

Exit mobile version