{"id":42996,"date":"2019-05-29T14:24:29","date_gmt":"2019-05-29T19:24:29","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?p=42996"},"modified":"2021-08-16T22:18:14","modified_gmt":"2021-08-17T02:18:14","slug":"check-and-repair-database-with-wp-cli","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/","title":{"rendered":"Check and Repair Database with WP-CLI"},"content":{"rendered":"\n<p>When a WordPress website shows an <em>Error establishing a database connection<\/em>, those with access to cPanel can check and repair databases using <strong><a href=\"\/support\/website\/check-and-repair-databases-in-cpanel\/\" rel=\"noopener noreferrer\" target=\"_blank\">MySQL Database<\/a><\/strong> or <strong><a href=\"\/support\/website\/check-repair-database\/\" rel=\"noopener noreferrer\" target=\"_blank\">phpMyAdmin<\/a><\/strong>. Below, we cover how web developers can <strong>check and repair a WordPress database using WP-CLI<\/strong>.<\/p>\n<p class=\"alert alert-info\"><strong>Note:<\/strong> You must navigate to the root folder of your WordPress installation in <a href=\"\/support\/server\/ssh\/do-you-provide-ssh-access\/\" rel=\"noopener noreferrer\" target=\"_blank\">SSH<\/a> or cPanel <a href=\"\/support\/edu\/cpanel\/how-to-launch-the-cpanel-terminal\/\" rel=\"noopener noreferrer\" target=\"_blank\">Terminal<\/a> to continue.<\/p>\n<h2>Check Database<\/h2>\n<p>Type the <span class=\"cli\">wp db check<\/span> <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/db\/check\/\" rel=\"noopener noreferrer\" target=\"_blank\">WP-CLI command<\/a>. You&#8217;ll see results listing each table, then <em>OK<\/em> or <br\/><em>note     : The storage engine for the table doesn&#8217;t support repair<\/em>.\n    <table class=\"article_table\" style=\"width:50%\">\n<tr>\n<td>cpuser01_bgri000.wpa0_terms<\/td>\n<td>OK<\/td>\n<\/tr>\n<tr>\n<td>cpuser01_bgri000.wpa0_usermeta<\/td>\n<td>OK<\/td>\n<\/tr>\n<tr>\n<td>cpuser01_bgri000.wpa0_users<\/td>\n<td>OK<\/td>\n<\/tr>\n<tr>\n<td><strong style=\"color: green;\">Success:<\/strong> Database checked.<\/td>\n<th><\/th>\n<\/tr>\n<\/table><\/p>\n<h2>Repair Database<\/h2>\n<p>Type the <span class=\"cli\">wp db repair<\/span> <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/db\/repair\/\" rel=\"noopener noreferrer\" target=\"_blank\">WP-CLI command<\/a>. You&#8217;ll see results listing each table, then <em>OK<\/em> or <br\/><em>note     : The storage engine for the table doesn&#8217;t support repair<\/em>.\n    <table class=\"article_table\" style=\"width:50%\">\n<tr>\n<td>cpuser01_bgri000.wpa0_terms<\/td>\n<td>OK<\/td>\n<\/tr>\n<tr>\n<td>cpuser01_bgri000.wpa0_usermeta<\/td>\n<td>OK<\/td>\n<\/tr>\n<tr>\n<td>cpuser01_bgri000.wpa0_users<\/td>\n<td>OK<\/td>\n<\/tr>\n<tr>\n<td><strong style=\"color: green;\">Success:<\/strong> Database repaired.<\/td>\n<th><\/th>\n<\/tr>\n<\/table><\/p>\n<br\/><p>If this doesn&#8217;t fix your issue, even after <a href=\"\/support\/website\/how-to-clear-browser-cache-for-major-browsers\/\" rel=\"noopener noreferrer\" target=\"_blank\">clearing your browser<\/a> and <a href=\"\/support\/website\/cache-manager-cpanel\/\" rel=\"noopener noreferrer\" target=\"_blank\">server cache<\/a>, please contact our <a href=\"\/support\/amp\/how-to-get-great-technical-support\/\" rel=\"noopener noreferrer\" target=\"_blank\">Live Support<\/a> for further assistance.<\/p>\n\n\n<p>Learn more about <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/\">WP-CLI<\/a>, the command-line interface for WordPress, and how to streamline your WordPress maintenance workflows!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When a WordPress website shows an Error establishing a database connection, those with access to cPanel can check and repair databases using MySQL Database or phpMyAdmin. Below, we cover how web developers can check and repair a WordPress database using WP-CLI. Note: You must navigate to the root folder of your WordPress installation in SSH<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4374],"tags":[],"class_list":["post-42996","post","type-post","status-publish","format-standard","hentry","category-wp-cli"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Check and Repair Database with WP-CLI | InMotion Hosting<\/title>\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.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Check and Repair Database with WP-CLI | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"When a WordPress website shows an Error establishing a database connection, those with access to cPanel can check and repair databases using MySQL Database or phpMyAdmin. Below, we cover how web developers can check and repair a WordPress database using WP-CLI. Note: You must navigate to the root folder of your WordPress installation in SSH Read More &gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-29T19:24:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T02:18:14+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"Check and Repair Database with WP-CLI\",\"datePublished\":\"2019-05-29T19:24:29+00:00\",\"dateModified\":\"2021-08-17T02:18:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/\"},\"wordCount\":188,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"WP-CLI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/\",\"name\":\"Check and Repair Database with WP-CLI | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2019-05-29T19:24:29+00:00\",\"dateModified\":\"2021-08-17T02:18:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Check and Repair Database with WP-CLI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Check and Repair Database with WP-CLI | InMotion Hosting","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.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/","og_locale":"en_US","og_type":"article","og_title":"Check and Repair Database with WP-CLI | InMotion Hosting","og_description":"When a WordPress website shows an Error establishing a database connection, those with access to cPanel can check and repair databases using MySQL Database or phpMyAdmin. Below, we cover how web developers can check and repair a WordPress database using WP-CLI. Note: You must navigate to the root folder of your WordPress installation in SSH Read More >","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2019-05-29T19:24:29+00:00","article_modified_time":"2021-08-17T02:18:14+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"Check and Repair Database with WP-CLI","datePublished":"2019-05-29T19:24:29+00:00","dateModified":"2021-08-17T02:18:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/"},"wordCount":188,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["WP-CLI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/","name":"Check and Repair Database with WP-CLI | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2019-05-29T19:24:29+00:00","dateModified":"2021-08-17T02:18:14+00:00","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/check-and-repair-database-with-wp-cli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Check and Repair Database with WP-CLI"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4374,"name":"WP-CLI","slug":"wp-cli","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/wp-cli\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/42996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=42996"}],"version-history":[{"count":3,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/42996\/revisions"}],"predecessor-version":[{"id":83446,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/42996\/revisions\/83446"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=42996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=42996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=42996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}