{"id":125,"date":"2011-12-02T15:30:00","date_gmt":"2011-12-02T15:30:00","guid":{"rendered":"http:\/\/pheonixsolutions.com\/?p=125"},"modified":"2026-09-16T12:18:47","modified_gmt":"2026-09-16T06:48:47","slug":"phpmyadmin-error","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/phpmyadmin-error\/","title":{"rendered":"Resolve the PHPMyAdmin #2002 MySQL Connection Error in WHM"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While accessing <strong>phpMyAdmin through WHM<\/strong>, you may encounter the following MySQL connection error:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#2002 \u2013 The server is not responding (or the local MySQL server\u2019s socket is not correctly configured)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This issue commonly occurs when the MySQL socket file is missing from the expected location or when phpMyAdmin is configured to use an incorrect socket path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this blog, we will explain two approaches to resolve the phpMyAdmin <strong>#2002 connection error<\/strong> by correcting the MySQL socket configuration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before implementing the solution, ensure that you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Root or SSH access to the server.<\/li>\n\n\n\n<li>Access to WHM.<\/li>\n\n\n\n<li>phpMyAdmin installed through cPanel\/WHM.<\/li>\n\n\n\n<li>MySQL or MariaDB running on the server.<\/li>\n\n\n\n<li>Basic knowledge of Linux commands and configuration files.<\/li>\n\n\n\n<li>Basic knowledge of MySQL socket configuration.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Error Message<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When accessing phpMyAdmin from WHM, you may encounter:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#2002 \u2013 The server is not responding\n(or the local MySQL server\u2019s socket is not correctly configured)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This indicates that phpMyAdmin is unable to establish a connection with the local MySQL server using the configured connection method.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Reason<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The error can occur when:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The MySQL socket file is not available at the location expected by phpMyAdmin.<\/li>\n\n\n\n<li>phpMyAdmin is configured with an incorrect socket path.<\/li>\n\n\n\n<li>The configured connection type does not match the available MySQL connection method.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Before making changes, you can check whether the MySQL socket exists:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ls -l \/var\/lib\/mysql\/mysql.sock<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the socket exists at <code>\/var\/lib\/mysql\/mysql.sock<\/code>, you can use either of the following solutions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution 1: Create a Symbolic Link for the MySQL Socket<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If an application expects the MySQL socket at <code>\/tmp\/mysql.sock<\/code>, you can create a symbolic link pointing to the actual MySQL socket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ln -s \/var\/lib\/mysql\/mysql.sock \/tmp\/mysql.sock<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify the symbolic link:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ls -l \/tmp\/mysql.sock<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It should point to:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/var\/lib\/mysql\/mysql.sock<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After creating the symbolic link, try accessing phpMyAdmin from WHM again.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Before creating the symbolic link, verify that <code>\/tmp\/mysql.sock<\/code> does not already exist. If it exists, investigate its target before replacing or modifying it.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Solution 2: Update the phpMyAdmin Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the symbolic link approach does not resolve the issue, you can configure phpMyAdmin to use the correct MySQL socket directly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the phpMyAdmin configuration file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vi \/usr\/local\/cpanel\/base\/3rdparty\/phpMyAdmin\/config.inc.php<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Configure the MySQL Socket<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Locate:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$cfg['Servers'][$i]['socket'] = '';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change it to:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$cfg['Servers'][$i]['socket'] = '\/var\/lib\/mysql\/mysql.sock';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This tells phpMyAdmin to use the MySQL socket located at:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/var\/lib\/mysql\/mysql.sock<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Configure the Connection Type<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Locate:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$cfg['Servers'][$i]['connect_type'] = 'tcp';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change it to:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$cfg['Servers'][$i]['connect_type'] = 'socket';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This configures phpMyAdmin to connect to MySQL using the Unix socket instead of a TCP connection.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Save the Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Save the changes and exit the editor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can then try accessing phpMyAdmin again through WHM.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Verify the MySQL Service<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the issue persists, verify that MySQL\/MariaDB is running:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl status mysql<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on the server configuration, you may also need to check:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl status mariadb<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also verify the socket location using:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mysqladmin variables | grep socket<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Architecture Diagram<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/image.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"881\" height=\"457\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/image.png\" alt=\"\" class=\"wp-image-11806\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/image.png 881w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/image-300x156.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/image-768x398.png 768w\" sizes=\"(max-width: 881px) 100vw, 881px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The phpMyAdmin <strong>#2002 MySQL connection error<\/strong> can occur when phpMyAdmin cannot locate or connect to the MySQL server through the expected socket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The issue can be addressed by either:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Creating a symbolic link from the MySQL socket to <code>\/tmp\/mysql.sock<\/code>, or<\/li>\n\n\n\n<li>Updating phpMyAdmin to use the correct MySQL socket directly.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The actual socket location should be verified before making configuration changes. Once the correct socket path and connection type are configured, phpMyAdmin should be able to establish a local connection to the MySQL server.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">1. What does the phpMyAdmin #2002 error mean?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>#2002<\/code> error generally indicates that phpMyAdmin cannot establish a connection to the local MySQL\/MariaDB server, commonly because of an incorrect or unavailable socket configuration.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. How can I check whether the MySQL socket exists?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ls -l \/var\/lib\/mysql\/mysql.sock<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. How can I find the configured MySQL socket?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mysqladmin variables | grep socket<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This can help identify the socket path used by MySQL.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4. What is a MySQL socket?<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">A Unix socket is a local communication mechanism used by applications such as phpMyAdmin to communicate with the MySQL\/MariaDB server without using a network connection.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/enabling-various-php-parameters-using-htaccess-file-and-php-ini-file\/?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noreferrer noopener\">Enabling Various PHP Parameters Using .htaccess File and php.ini File<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business? Our team of experts can help you with development, cloud, DevOps, design, and a wide range of other technology needs. Get in touch with our team <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/pheonixsolutions.com\/contact?utm_source=chatgpt.com\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction While accessing phpMyAdmin through WHM, you may encounter the following MySQL connection error: This issue commonly occurs when the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[],"class_list":["post-125","post","type-post","status-publish","format-standard","hentry","category-web-architecture","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-21","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":11808,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/125\/revisions\/11808"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}