Skip to content
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Solutions
    By Role
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    By Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    By Cloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    Partner Program
    Exclusive discounts, benefits and exposure to take your business to the next level
    Become a partner
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    Explore Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    Key Topics
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    Feature Packs
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    Featured Extension
    SocialBee
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • Extension
  • Pricing
  • Extensions
  • Help Center
  • More
    • Careers
    • Events
    • Plesk University
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL

Knowledge Base

The error in Plesk: ERR [panel] SQLSTATE[HY000] [2002] No such file or directory, Can’t connect to local MySQL server through socket

 
databasedatabasesdebianmariadbmysql

Symptoms

  • The following error is shown instead of the Plesk login page:

    ERR [panel] SQLSTATE[HY000] [2002] No such file or directory

  • Generation of the login link fails:

    # plesk login
    ERR [panel] SQLSTATE[HY000] [2002] No such file or directory:
    0: /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:144
    ..........
    ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory (Abstract.php:144)

  • It is possible to login to the Plesk configuration database (psa) using the command:

    # plesk db

  • No errors can be found in the MySQL/MariaDB error log (can be located at /var/log/mysqld.log, /var/log/mariadb/mariadb.log or /var/log/mysql/error.log) even during the restart of the service.

  • Manual running of the backupmng utility fails with the following error:

    # plesk sbin backupmng
    backupmng: Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
    System error 13: Permission denied
    backupmng: Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
    System error 13: Permission denied
    backupmng: Unable to connect to the mysql database

  • When deleting a domain or a subscription from Plesk, the following error can be found in the file /var/log/plesk/panel.log:

    PHP Fatal error: Uncaught exception 'PleskMultipleException' with message 'Error during example.com removeZone: dnsmng failed: dnsmng: Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    System error 2: No such file or directory
    dnsmng: Unable to connect to the mysql database
    System error 2: No such file or directory
    in /opt/psa/admin/plib/Service/Dns/Connector/Plesk.php:14
    Stack trace:
    ..........
    thrown in /opt/psa/admin/plib/Service/Dns/Connector/Plesk.php on line 14

Cause

The sockets specified in the files /etc/psa/psa.conf and /usr/local/psa/admin/conf/php.ini differ from the actual MySQL/MariaDB socket defined in the file /etc/my.cnf (/etc/mysql/my.cnf on Debian and Ubuntu).

Resolution

  1. Connect to the server using SSH.

  2. Make sure that the sockets to connect to the MySQL/MariaDB server specified in the files /etc/psa/psa.conf and /usr/local/psa/admin/conf/php.ini are the same as the socket defined in the file /etc/my.cnf (/etc/mysql/my.cnf on Debian and Ubuntu):

    # grep mysql.sock /etc/my.cnf
    socket=/var/lib/mysql/mysql.sock

    # grep mysql.sock /etc/psa/psa.conf
    MYSQL_SOCKET /var/lib/mysql/mysql.sock

    # grep mysql.sock /usr/local/psa/admin/conf/php.ini
    pdo_mysql.default_socket="/var/lib/mysql/mysql.sock"

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

MariaDB vs MongoDB: Which One To Choose?

Read More »

Plesk with Centralized Database and Network File System

Read More »

Recommended OSs for Plesk

Read More »
Knowledge Base

How to reinstall phpMyAdmin in Plesk for Linux

Read More »

MySQL/MariaDB service fails to start on a Plesk server: Table ‘mysql.user’ doesn’t exist

Read More »

A MySQL/MariaDB query executed in phpMyAdmin/PHP script fails when the ONLY_FULL_GROUP_BY SQL mode is configured

Read More »

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

Read More »

Hosting Wiki

  • Server Redundancy
  • Bare Metal Server
  • MySQL
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • PHP
  • SQL
  • Plesk
  • SQL database
  • NoSQL Database
  • Web Server
  • DNS Server
  • SSH

Industry
Partners

industry-partner_ALIBABA
industry-partner_GOOGLEPARTNER
industry-partner_MICROSOFT
industry-partner_REDHAT-r2
industry-partner_ALIBABA
industry-partner_AUTOMATTIC
industry-partner_AWS
industry-partner_DIGITALOCEAN
industry-partner_SCALEWAY
Follow us:
Facebook Twitter Linkedin Youtube Github

COMPANY

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY

Blog
Forums 
Plesk University

First defaul

Company

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE​

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS​

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY​

Blog
Forums
Plesk University

Follow us:
Facebook Twitter Linkedin Youtube Github

© 2025 WebPros International GmbH. All rights reserved. Plesk and the Plesk logo are trademarks of WebPros International GmbH.

Managed with love with Plesk WP Toolkit