{"id":643,"date":"2012-11-12T09:34:23","date_gmt":"2012-11-12T09:34:23","guid":{"rendered":"http:\/\/www.plugged.in\/?p=643"},"modified":"2018-11-07T23:41:22","modified_gmt":"2018-11-07T20:41:22","slug":"mysql-server-wont-start-pid-file-errors","status":"publish","type":"post","link":"https:\/\/www.veriteknik.net.tr\/en\/mysql-server-wont-start-pid-file-errors\/","title":{"rendered":"MySQL Server Won&#8217;t Start : PID File Errors"},"content":{"rendered":"<p>This is kind of a common problem and may have several reasons. Sometimes when we simply want to restart the MySQL Server, we can get such an error:<br \/>\nERROR! MySQL server PID file could not be found!<\/p>\n<p>First of all, always check if the \/tmp partition is full. This can happen when MySQL can&#8217;t write to the <strong>\/tmp<\/strong> partition to create a lock file.<br \/>\n<strong>$ df -h<\/strong><\/p>\n<p>Also, this may be because, somehow the <strong>\/tmp<\/strong> partition has been cleared and the MySQL server is looking for the PID file there. So easy-peasy just create a new pid file and restart the server.<br \/>\n<strong>$ touch \/tmp\/mysql.sock<\/strong><br \/>\n<strong>$ service mysqld restart<\/strong><\/p>\n<p>It can also help to check the status, sometimes it helps. For example sometimes you can get an error like this :<br \/>\n<strong>$ service mysqld status<\/strong><br \/>\n<strong>ERROR! MySQL is not running, but lock file (\/var\/lock\/subsys\/mysql) exists<\/strong><\/p>\n<p>Well, it&#8217;s kind of obvious, just remove the lock file and restart the server.<\/p>\n<p><strong>$ rm \/var\/lock\/subsys\/mysql<\/strong><br \/>\n<strong>$ service mysqld restart<\/strong><\/p>\n<p>If none of these help, and you&#8217;re getting an error like this:<br \/>\n<strong>$ service mysqld restart<\/strong><br \/>\n<strong>ERROR! MySQL server PID file could not be found!<\/strong><br \/>\n<strong>Starting MySQL. ERROR! The server quit without updating PID file (\/var\/lib\/mysql\/mydomain.com.pid).<\/strong><\/p>\n<p>Then there might be a more complicated problem. Check the log file at <strong>\/var\/lib\/mysql\/mydomain.com.err<\/strong><br \/>\n<strong>$ tail \/var\/lib\/mysql\/mydomain.com.err<\/strong><br \/>\n<strong>120602 16:54:09 mysqld_safe mysqld from pid file \/var\/lib\/mysql\/mydomain.com.pid ended<\/strong><\/p>\n<p>This line tells us that we have a compatibility problem with some of our tables and mysql fails to start in safe mode.<\/p>\n<p>Now let&#8217;s change the way mysql starts to work around this situtation.<\/p>\n<p><strong>$ { echo &#8220;mysql_enable=\\&#8221;YES\\&#8221;&#8221;; echo &#8220;mysql_args=\\&#8221;&#8211;skip-grant-tables &#8211;skip-networking\\&#8221;&#8221;; } &gt;&gt; \/etc\/init\/rc.conf<\/strong><\/p>\n<p>Time to restart<\/p>\n<p><strong>$ \/etc\/init.d\/mysqld restart<\/strong><\/p>\n<p>You should a get successfull restart. Now try and upgrade the server.<br \/>\n<strong>$ mysql_upgrade<\/strong><\/p>\n<p>If it says you have the latest version, still force it.<br \/>\n<strong>$ mysql_upgrade &#8211;force<\/strong><\/p>\n<p>It will check every database if it&#8217;s ok. After that, we can return things to normal, comment out the last line we&#8217;ve added to<strong> \/etc\/init\/rc.conf<\/strong><\/p>\n<p><strong>$ sed -i &#8216;\/mysql_args\/s\/^\/#\/&#8217; \/etc\/init\/rc.conf<\/strong><br \/>\n<strong>$ service mysqld restart<\/strong><\/p>\n<p>Hope this helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is kind of a common problem and may have several reasons. Sometimes when we simply want to restart the MySQL Server, we can get such an error: ERROR! MySQL server PID file could not be found! First of all, always check if the \/tmp partition is full. This can happen when MySQL can&#8217;t write [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[363,364],"tags":[373,689],"yst_prominent_words":[682,605,688,684,675,683,665,680,677,673,681,674,679,686,685,337,687,678,676,672],"class_list":["post-643","post","type-post","status-publish","format-standard","hentry","category-databases","category-mysql-databases","tag-mysql","tag-pid"],"jetpack_featured_media_url":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Mustafa Emre Ayd\u0131n","author_link":"https:\/\/www.veriteknik.net.tr\/en\/author\/eaydin\/"},"uagb_comment_info":0,"uagb_excerpt":"This is kind of a common problem and may have several reasons. Sometimes when we simply want to restart the MySQL Server, we can get such an error: ERROR! MySQL server PID file could not be found! First of all, always check if the \/tmp partition is full. This can happen when MySQL can&#8217;t write&hellip;","_links":{"self":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/comments?post=643"}],"version-history":[{"count":1,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/643\/revisions"}],"predecessor-version":[{"id":4166,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/643\/revisions\/4166"}],"wp:attachment":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/media?parent=643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/categories?post=643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/tags?post=643"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/yst_prominent_words?post=643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}