{"id":621,"date":"2013-05-02T17:07:26","date_gmt":"2013-05-02T16:07:26","guid":{"rendered":"http:\/\/www.jbahillo.com\/?p=621"},"modified":"2013-05-02T20:30:38","modified_gmt":"2013-05-02T19:30:38","slug":"panic-mysql-is-not-starting","status":"publish","type":"post","link":"https:\/\/www.jbahillo.com\/?p=621","title":{"rendered":"Panic! Mysql is not starting!"},"content":{"rendered":"<p>Last Tuesday I found an issue a still did not found in which mysql was not starting. Looking at the logs showed this logs:<\/p>\n<pre class=\"brush: bash; gutter: true\">Fatal error: Can\u2019t open and lock privilege tables: Can\u2019t find file: \u2018host\u2019 (errno: 2)<\/pre>\n<p>Ok, so what should we do now? Well, case you had (something I would recommend to backups for \/var\/lib\/mysql you could restore \/var\/lib\/mysql\/mysql<\/p>\n<p>If not, do not worry, you&#8217;re still not lost (or not too much)<\/p>\n<p>First you have to manage to run mysql, even without such table. for doing so just run:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []; html-script: false\">mysqld_safe --skip-grant-tables<\/pre>\n<p>So now mysqld is running, and now? just use the sql command restore:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []; html-script: false\">mysql\nmysql&gt; use mysql\nmysql&gt; REPAIR TABLE host ;<\/pre>\n<p>Many times this command won&#8217;t be working so you can still use:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1; highlight: []; html-script: false\">mysql&gt; REPAIR TABLE host USE_FRM;<\/pre>\n<p>Once done this. restart your mysqld and you will be up and running!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last Tuesday I found an issue a still did not found in which mysql was not starting. Looking at the logs showed this logs: Fatal error: Can\u2019t open and lock privilege tables: Can\u2019t find file: \u2018host\u2019 (errno: 2) Ok, so&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.jbahillo.com\/?p=621\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_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":[10,38],"tags":[117,116,118],"class_list":["post-621","post","type-post","status-publish","format-standard","hentry","category-gnulinux","category-sql","tag-host","tag-mysqld","tag-priviledge-table"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Procedure to fix corrupt priviledge tables in mysqld: Can\u2019t open and lock privilege tables\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Javier Bahillo\"\/>\n\t<meta name=\"keywords\" content=\"mysqld,host,priviledge table,gnu\/linux,sql\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.jbahillo.com\/?p=621\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"es_ES\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Javier Bahillo | Blog de un Administrador de Sistemas\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Panic! Mysql is not starting! | Javier Bahillo\" \/>\n\t\t<meta property=\"og:description\" content=\"Procedure to fix corrupt priviledge tables in mysqld: Can\u2019t open and lock privilege tables\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.jbahillo.com\/?p=621\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-05-02T16:07:26+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-05-02T19:30:38+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Panic! Mysql is not starting! | Javier Bahillo\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Procedure to fix corrupt priviledge tables in mysqld: Can\u2019t open and lock privilege tables\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#article\",\"name\":\"Panic! Mysql is not starting! | Javier Bahillo\",\"headline\":\"Panic! Mysql is not starting!\",\"author\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?author=21#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#organization\"},\"datePublished\":\"2013-05-02T17:07:26+01:00\",\"dateModified\":\"2013-05-02T20:30:38+01:00\",\"inLanguage\":\"es-ES\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#webpage\"},\"articleSection\":\"GNU\\\/Linux, SQL, host, mysqld, priviledge table\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com#listItem\",\"position\":1,\"name\":\"Inicio\",\"item\":\"https:\\\/\\\/www.jbahillo.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?cat=10#listItem\",\"name\":\"GNU\\\/Linux\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?cat=10#listItem\",\"position\":2,\"name\":\"GNU\\\/Linux\",\"item\":\"https:\\\/\\\/www.jbahillo.com\\\/?cat=10\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#listItem\",\"name\":\"Panic! Mysql is not starting!\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com#listItem\",\"name\":\"Inicio\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#listItem\",\"position\":3,\"name\":\"Panic! Mysql is not starting!\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?cat=10#listItem\",\"name\":\"GNU\\\/Linux\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#organization\",\"name\":\"Javier Bahillo\",\"description\":\"Blog de un Administrador de Sistemas\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?author=21#author\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/?author=21\",\"name\":\"Javier Bahillo\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23ebe4a43dc73242549ef5e7aeabbb6f292b190480d690968359ac9f5d180474?s=96&r=g\",\"width\":96,\"height\":96,\"caption\":\"Javier Bahillo\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#webpage\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621\",\"name\":\"Panic! Mysql is not starting! | Javier Bahillo\",\"description\":\"Procedure to fix corrupt priviledge tables in mysqld: Can\\u2019t open and lock privilege tables\",\"inLanguage\":\"es-ES\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?p=621#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?author=21#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/?author=21#author\"},\"datePublished\":\"2013-05-02T17:07:26+01:00\",\"dateModified\":\"2013-05-02T20:30:38+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#website\",\"url\":\"https:\\\/\\\/www.jbahillo.com\\\/\",\"name\":\"Javier Bahillo\",\"description\":\"Blog de un Administrador de Sistemas\",\"inLanguage\":\"es-ES\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.jbahillo.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Panic! Mysql is not starting! | Javier Bahillo","description":"Procedure to fix corrupt priviledge tables in mysqld: Can\u2019t open and lock privilege tables","canonical_url":"https:\/\/www.jbahillo.com\/?p=621","robots":"max-image-preview:large","keywords":"mysqld,host,priviledge table,gnu\/linux,sql","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.jbahillo.com\/?p=621#article","name":"Panic! Mysql is not starting! | Javier Bahillo","headline":"Panic! Mysql is not starting!","author":{"@id":"https:\/\/www.jbahillo.com\/?author=21#author"},"publisher":{"@id":"https:\/\/www.jbahillo.com\/#organization"},"datePublished":"2013-05-02T17:07:26+01:00","dateModified":"2013-05-02T20:30:38+01:00","inLanguage":"es-ES","mainEntityOfPage":{"@id":"https:\/\/www.jbahillo.com\/?p=621#webpage"},"isPartOf":{"@id":"https:\/\/www.jbahillo.com\/?p=621#webpage"},"articleSection":"GNU\/Linux, SQL, host, mysqld, priviledge table"},{"@type":"BreadcrumbList","@id":"https:\/\/www.jbahillo.com\/?p=621#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com#listItem","position":1,"name":"Inicio","item":"https:\/\/www.jbahillo.com","nextItem":{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?cat=10#listItem","name":"GNU\/Linux"}},{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?cat=10#listItem","position":2,"name":"GNU\/Linux","item":"https:\/\/www.jbahillo.com\/?cat=10","nextItem":{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?p=621#listItem","name":"Panic! Mysql is not starting!"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com#listItem","name":"Inicio"}},{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?p=621#listItem","position":3,"name":"Panic! Mysql is not starting!","previousItem":{"@type":"ListItem","@id":"https:\/\/www.jbahillo.com\/?cat=10#listItem","name":"GNU\/Linux"}}]},{"@type":"Organization","@id":"https:\/\/www.jbahillo.com\/#organization","name":"Javier Bahillo","description":"Blog de un Administrador de Sistemas","url":"https:\/\/www.jbahillo.com\/"},{"@type":"Person","@id":"https:\/\/www.jbahillo.com\/?author=21#author","url":"https:\/\/www.jbahillo.com\/?author=21","name":"Javier Bahillo","image":{"@type":"ImageObject","@id":"https:\/\/www.jbahillo.com\/?p=621#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/23ebe4a43dc73242549ef5e7aeabbb6f292b190480d690968359ac9f5d180474?s=96&r=g","width":96,"height":96,"caption":"Javier Bahillo"}},{"@type":"WebPage","@id":"https:\/\/www.jbahillo.com\/?p=621#webpage","url":"https:\/\/www.jbahillo.com\/?p=621","name":"Panic! Mysql is not starting! | Javier Bahillo","description":"Procedure to fix corrupt priviledge tables in mysqld: Can\u2019t open and lock privilege tables","inLanguage":"es-ES","isPartOf":{"@id":"https:\/\/www.jbahillo.com\/#website"},"breadcrumb":{"@id":"https:\/\/www.jbahillo.com\/?p=621#breadcrumblist"},"author":{"@id":"https:\/\/www.jbahillo.com\/?author=21#author"},"creator":{"@id":"https:\/\/www.jbahillo.com\/?author=21#author"},"datePublished":"2013-05-02T17:07:26+01:00","dateModified":"2013-05-02T20:30:38+01:00"},{"@type":"WebSite","@id":"https:\/\/www.jbahillo.com\/#website","url":"https:\/\/www.jbahillo.com\/","name":"Javier Bahillo","description":"Blog de un Administrador de Sistemas","inLanguage":"es-ES","publisher":{"@id":"https:\/\/www.jbahillo.com\/#organization"}}]},"og:locale":"es_ES","og:site_name":"Javier Bahillo | Blog de un Administrador de Sistemas","og:type":"article","og:title":"Panic! Mysql is not starting! | Javier Bahillo","og:description":"Procedure to fix corrupt priviledge tables in mysqld: Can\u2019t open and lock privilege tables","og:url":"https:\/\/www.jbahillo.com\/?p=621","article:published_time":"2013-05-02T16:07:26+00:00","article:modified_time":"2013-05-02T19:30:38+00:00","twitter:card":"summary","twitter:title":"Panic! Mysql is not starting! | Javier Bahillo","twitter:description":"Procedure to fix corrupt priviledge tables in mysqld: Can\u2019t open and lock privilege tables"},"aioseo_meta_data":{"post_id":"621","title":"Panic! Mysql is not starting! | #site_title","description":"Procedure to fix corrupt priviledge tables in mysqld: Can\u2019t open and lock privilege tables","keywords":[{"label":"mysqld","value":"mysqld"},{"label":"host","value":"host"},{"label":"priviledge table","value":"priviledge table"}],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"","defaultPostTypeGraph":""},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-04-23 20:46:55","updated":"2026-09-11 17:06:48","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p74T96-a1","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/posts\/621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=621"}],"version-history":[{"count":4,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/posts\/621\/revisions"}],"predecessor-version":[{"id":624,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=\/wp\/v2\/posts\/621\/revisions\/624"}],"wp:attachment":[{"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jbahillo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}