{"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":{"jetpack_post_was_ever_published":false,"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_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}},"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":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p74T96-a1","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_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}]}}