Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

MySQL/MariaDB service cannot be started during Plesk update: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket

 
installation upgrademariadbmysqlosplesk for linux

Symptoms

  • MySQL/MariaDB server is not started during Plesk update. The following errors can be found in /var/log/plesk/install/autoinstaller3.log :

    Failed to start mysql.service: Unit not found.
    Trying to start service mysql... inactive
    WARNING!
    Some problems are found during start service mysql(see log file: /var/log/plesk/install/plesk_18.0.28_installation.log)
    Continue...
    Trying to start service mysql... inactive
    Trying to establish test connection...ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

  • Checking mysql service status with systemctl utility results in:

    # systemctl status mariadb.service
    Unit mariadb.service could not be found.
    # systemctl status mysql.service
    Unit mariadb.service could not be found.
    # systemctl status mysqld.service
    Unit mariadb.service could not be found.

  • mysql service can be started manually with the command:

    # service mysql start

  • SystemD-based OS is used

Cause

MySQL or MariaDB service misconfiguration.

Symbolic link for mysql service in /etc/systemd/system/ directory points to non-existing file:

# ls -la /etc/systemd/system/mariadb.service
lrwxrwxrwx 1 root root 38 Jul 29 2016 mariadb.service -> /usr/lib/systemd/system/mysqld.service
# ls -la /usr/lib/systemd/system/mysqld.service
ls: cannot access /usr/lib/systemd/system/mysqld.service: No such file or directory

Resolution

  1. Log in to Plesk server using SSH.

  2. Make sure that service definition is installed in /usr/lib/systemd/system/mariadb.service.

    # ls -la /usr/lib/systemd/system/mariadb.service
    -rw-r--r-- 1 root root 1697 Aug 16 2018 /usr/lib/systemd/system/mariadb.service

  3. Make sure that there is no startup script for mysql service in /etc/init.d/ directory and remove if it exists:

    # rm -f /etc/init.d/mysql

  4. Remove broken symbolic link:

    # rm -f /etc/systemd/system/mariadb.service

  5. Reload systemd daemon:

    # systemctl daemon-reload

 

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

MariaDB vs MongoDB: Which One To Choose?

Read More »

Recommended OSs for Plesk

Read More »

PostgreSQL vs MySQL: A Comparison Of The Popular Database Management Systems

Read More »
Knowledge Base

MariaDB fails to start: Aria engine is not enabled or did not start

Read More »

Plesk Update Manager fails to install system updates: Failed to solve dependencies: Plesk installation requires ‘epel’ OS repository to be enabled

Read More »

Plesk Update fails: Table ‘mysql.innodb_index_stats’ doesn’t exist in engine

Read More »

Unable to update Plesk Obsidian: mariadb-server >= 5.0.60 is needed by plesk-mysql-server-18.0.2-2.centos.7+p18.0.45.2+t220722.0939.noarch – Plesk

Read More »

Hosting Wiki

  • Cross Site Request Forgery (CSRF)
  • Cross-Origin Resource Sharing (CORS)
  • Server Redundancy
  • Postfix
  • PostgreSQL
  • AMP
  • DDoS
  • Bare Metal Server
  • MySQL
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • SQL
  • Hosting Control Panel
  • Plesk
  • NoSQL Database
  • Web Server
  • DNS Server
  • SSH
  • Colocation Hosting
  • Reseller Hosting
  • Cloud Hosting
  • VPS Hosting
  • Dedicated Hosting
  • Shared Hosting
  • Free Hosting
  • Managed Hosting
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family