{"id":6298,"date":"2021-03-31T12:43:28","date_gmt":"2021-03-31T07:13:28","guid":{"rendered":"https:\/\/www.skynats.com\/?p=6298"},"modified":"2024-12-11T17:48:29","modified_gmt":"2024-12-11T12:18:29","slug":"pleskdbexception-unable-to-connect-to-database-error","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/","title":{"rendered":"\u2018PleskDBException: Unable to connect to database Error\u2019"},"content":{"rendered":"\n<p>The error is caused by the various reason that includes disk space full, InnoDB engine corruption, and data directory not completely restored.<\/p>\n\n\n\n<p>Our technical team support will fix the Plesk error under our <a href=\"https:\/\/www.skynats.com\/plesk-server-management\/ \" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#0271a0\" class=\"has-inline-color\">Plesk server management services<\/span><\/a> plan. You can also take assistance from our technical team support 24\/7 for fixing the error or any sort of installation and migration.&nbsp;<\/p>\n\n\n\n<p><strong>How to fix error<\/strong><\/p>\n\n\n\n<p>This was one of the client reports that tell us that he tries to access the Plesk control panel and the following error appears on the screen.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u201cERROR: PleskDBException: Unable to connect to database: mysql_connect(): No such file or directory \/var\/run\/mysqld\/mysqld.sock (Error code: 2002). Please check that the database server is started and accessible. (Abstract.php:69)\u201d<\/code><\/pre>\n\n\n\n<p>Whereas MySQL is working well and even the web application has worked well without any sort of issues.<\/p>\n\n\n\n<p>Resolve this error.<\/p>\n\n\n\n<p>We went through the MySQL logs by running the below command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep mysql \/var\/log\/syslog | tail -50<\/code><\/pre>\n\n\n\n<p>The following are the result.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Mar 21 00:16:58 h2600744 \/etc\/init.d\/mysql&#91;29323]: 0 processes alive and \u2018\/usr\/bin\/mysqladmin \u2013defaults-file=\/etc\/mysql\/debian.cnf ping\u2019 resulted in Mar 21 00:16:58 h2600744 \/etc\/init.d\/mysql&#91;29323]: #007\/usr\/bin\/mysqladmin: connect to server at \u2018localhost\u2019 failed<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Mar 21 00:16:58 h2600744 \/etc\/init.d\/mysql&#91;29323]: error: \u2018Can\u2019t connect to local MySQL server through socket \u2018\/var\/run\/mysqld\/mysqld.sock\u2019 (2)\u2019 Aug 12 00:16:58 h2600744 \/etc\/init.d\/mysql&#91;29323]: Check that mysqld is running and that the socket: \u2018\/var\/run\/mysqld\/mysqld.sock\u2019 exists!<\/code><\/pre>\n\n\n\n<p>Follow the few steps to resolve this error<\/p>\n\n\n\n<p>First, we rename the file \/etc\/init\/mysql.conf to \/etc\/init\/mysql.conf.off. For that, you need to run the below command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># mv \/etc\/init\/mysql.conf \/etc\/init\/mysql.conf.off<\/code><\/pre>\n\n\n\n<p>Later, run the command to restart the MySQL service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># sudo service mysql stop\n# sudo service mysql start\u200b<\/code><\/pre>\n\n\n\n<p>Also, we can also perform \u201cplesk repair db -v\u201d.<\/p>\n\n\n\n<p>The socket will not exist if mysqld refuses to start. So you need to check whether the data directory is restored properly. If not, you need to recover it.<\/p>\n\n\n\n<p>You need to delete the&nbsp;<strong>non<\/strong>-essential file, in order to gain some disk space by using the df and du commands.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># df -h<\/code><\/pre>\n\n\n\n<p>The du command displays disk usage.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># du -h<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Moreover, we can add the skip-grant-tables option into \/etc\/mysql\/my.cnf after that we should be able to start the database server.<\/p>\n\n\n\n<p><strong>Conclusion<\/strong><\/p>\n\n\n\n<p>In brief, the error is caused by the various reason that includes disk space full, InnoDB engine corruption, data directory not completely restored. Follow the steps to fix the problem, if you still face the issue you take our <a href=\"https:\/\/www.skynats.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#0171a0\" class=\"has-inline-color\">technical team support<\/span><\/a> to fix this error.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The error is caused by the various reason that includes disk space full, InnoDB engine corruption, and data directory not completely restored. Our technical team support will fix the Plesk error under our Plesk server management services plan. You can also take assistance from our technical team support 24\/7 for fixing the error or any [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,300,257,188,68],"tags":[530],"class_list":["post-6298","post","type-post","status-publish","format-standard","hentry","category-blog","category-database","category-mysql","category-plesk-server","category-server-management","tag-plesk-error"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>PleskDBException: Unable to connect to database Error<\/title>\n<meta name=\"description\" content=\"The error is caused by the various reason that includes disk space full, InnoDB engine corruption, and data directory not completely restored\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u2018PleskDBException: Unable to connect to database Error\u2019\" \/>\n<meta property=\"og:description\" content=\"The error is caused by the various reason that includes disk space full, InnoDB engine corruption, and data directory not completely restored\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/\" \/>\n<meta property=\"og:site_name\" content=\"Server Management Services | Cloud Management | Skynats\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/skynats\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-31T07:13:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-11T12:18:29+00:00\" \/>\n<meta name=\"author\" content=\"Pooja V\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@skynatstech\" \/>\n<meta name=\"twitter:site\" content=\"@skynatstech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pooja V\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/\"},\"author\":{\"name\":\"Pooja V\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/person\\\/030d5856dd5166055eecc07218d2455e\"},\"headline\":\"\u2018PleskDBException: Unable to connect to database Error\u2019\",\"datePublished\":\"2021-03-31T07:13:28+00:00\",\"dateModified\":\"2024-12-11T12:18:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/\"},\"wordCount\":313,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\"},\"keywords\":[\"plesk error\"],\"articleSection\":[\"Blog\",\"Database\",\"MySQL\",\"Plesk server\",\"server management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/\",\"name\":\"PleskDBException: Unable to connect to database Error\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-03-31T07:13:28+00:00\",\"dateModified\":\"2024-12-11T12:18:29+00:00\",\"description\":\"The error is caused by the various reason that includes disk space full, InnoDB engine corruption, and data directory not completely restored\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/pleskdbexception-unable-to-connect-to-database-error\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u2018PleskDBException: Unable to connect to database Error\u2019\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\",\"name\":\"Server Management Services | Cloud Management | Skynats\",\"description\":\"Server Management and Cloud Management\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#organization\",\"name\":\"Skynats Technologies\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Sknats-Logo-New-whole.png\",\"contentUrl\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Sknats-Logo-New-whole.png\",\"width\":989,\"height\":367,\"caption\":\"Skynats Technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/skynats\",\"https:\\\/\\\/x.com\\\/skynatstech\",\"https:\\\/\\\/www.instagram.com\\\/skynatstech\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/skynats-technologies\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCvTAjrFJ4_E2MJKwlDHomlg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.skynats.com\\\/blog\\\/#\\\/schema\\\/person\\\/030d5856dd5166055eecc07218d2455e\",\"name\":\"Pooja V\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acf2642637f84bdab7ffece47787a6a4ee655dab6404beac2a1a33db563041c4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acf2642637f84bdab7ffece47787a6a4ee655dab6404beac2a1a33db563041c4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/acf2642637f84bdab7ffece47787a6a4ee655dab6404beac2a1a33db563041c4?s=96&d=mm&r=g\",\"caption\":\"Pooja V\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PleskDBException: Unable to connect to database Error","description":"The error is caused by the various reason that includes disk space full, InnoDB engine corruption, and data directory not completely restored","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/","og_locale":"en_US","og_type":"article","og_title":"\u2018PleskDBException: Unable to connect to database Error\u2019","og_description":"The error is caused by the various reason that includes disk space full, InnoDB engine corruption, and data directory not completely restored","og_url":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/","og_site_name":"Server Management Services | Cloud Management | Skynats","article_publisher":"https:\/\/www.facebook.com\/skynats","article_published_time":"2021-03-31T07:13:28+00:00","article_modified_time":"2024-12-11T12:18:29+00:00","author":"Pooja V","twitter_card":"summary_large_image","twitter_creator":"@skynatstech","twitter_site":"@skynatstech","twitter_misc":{"Written by":"Pooja V","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/#article","isPartOf":{"@id":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/"},"author":{"name":"Pooja V","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/person\/030d5856dd5166055eecc07218d2455e"},"headline":"\u2018PleskDBException: Unable to connect to database Error\u2019","datePublished":"2021-03-31T07:13:28+00:00","dateModified":"2024-12-11T12:18:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/"},"wordCount":313,"commentCount":0,"publisher":{"@id":"https:\/\/www.skynats.com\/blog\/#organization"},"keywords":["plesk error"],"articleSection":["Blog","Database","MySQL","Plesk server","server management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/","url":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/","name":"PleskDBException: Unable to connect to database Error","isPartOf":{"@id":"https:\/\/www.skynats.com\/blog\/#website"},"datePublished":"2021-03-31T07:13:28+00:00","dateModified":"2024-12-11T12:18:29+00:00","description":"The error is caused by the various reason that includes disk space full, InnoDB engine corruption, and data directory not completely restored","breadcrumb":{"@id":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.skynats.com\/blog\/pleskdbexception-unable-to-connect-to-database-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.skynats.com\/blog\/"},{"@type":"ListItem","position":2,"name":"\u2018PleskDBException: Unable to connect to database Error\u2019"}]},{"@type":"WebSite","@id":"https:\/\/www.skynats.com\/blog\/#website","url":"https:\/\/www.skynats.com\/blog\/","name":"Server Management Services | Cloud Management | Skynats","description":"Server Management and Cloud Management","publisher":{"@id":"https:\/\/www.skynats.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.skynats.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.skynats.com\/blog\/#organization","name":"Skynats Technologies","url":"https:\/\/www.skynats.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/08\/Sknats-Logo-New-whole.png","contentUrl":"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2021\/08\/Sknats-Logo-New-whole.png","width":989,"height":367,"caption":"Skynats Technologies"},"image":{"@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/skynats","https:\/\/x.com\/skynatstech","https:\/\/www.instagram.com\/skynatstech\/","https:\/\/www.linkedin.com\/company\/skynats-technologies","https:\/\/www.youtube.com\/channel\/UCvTAjrFJ4_E2MJKwlDHomlg"]},{"@type":"Person","@id":"https:\/\/www.skynats.com\/blog\/#\/schema\/person\/030d5856dd5166055eecc07218d2455e","name":"Pooja V","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/acf2642637f84bdab7ffece47787a6a4ee655dab6404beac2a1a33db563041c4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/acf2642637f84bdab7ffece47787a6a4ee655dab6404beac2a1a33db563041c4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/acf2642637f84bdab7ffece47787a6a4ee655dab6404beac2a1a33db563041c4?s=96&d=mm&r=g","caption":"Pooja V"}}]}},"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=6298"}],"version-history":[{"count":0,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6298\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=6298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=6298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=6298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}