{"id":1028,"date":"2010-11-12T11:07:40","date_gmt":"2010-11-12T17:07:40","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=1028"},"modified":"2011-12-28T15:32:57","modified_gmt":"2011-12-28T21:32:57","slug":"mysql-starting-mysql-error-the-server-quit-without-updating-pid-file","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file\/","title":{"rendered":"MySQL: Starting MySQL&#8230;.. ERROR! The server quit without updating PID file"},"content":{"rendered":"<style>\nh2{\nmargin-top:20px;\nborder-top:1px dotted #999;\npadding-top:20px;\n}\n<\/style>\n<p><img decoding=\"async\" src=\"\/wordpress\/wp-content\/uploads\/2010\/11\/Homer.gif\" width=\"300\" class=\"alignleft\" \/><\/p>\n<p>This step-by-step guide is mainly for FreeBSD, however the idea is the same for Linux. Every once a while, when I update my FreeBSD box, the system likes to shutdown my MySQL server. Therefore, I need to start it again after the update is done. Unfortunately, the upgrade process is not smooth every time. Sometimes it will throw me some error.<\/p>\n<div style=\"margin-top:50px;\"><\/div>\n<pre>\r\n\/usr\/local\/etc\/rc.d\/mysql.server start\r\n<\/pre>\n<p>Oh well, I got the following error messages:<\/p>\n<pre>Starting MySQL..... ERROR! The server quit without updating PID file.\r\n<\/pre>\n<p>Sometimes, the message will tell you the exact location of which PID file:<\/p>\n<pre>\r\nStarting MySQL..... ERROR! The server quit without updating PID file (\/var\/db\/mysql\/www.icesquare.com.pid).\r\n<\/pre>\n<p>There are several solutions to troubleshoot these problems. I will go over each one by one.<\/p>\n<h2>Solution 1: Reboot The Computer<\/h2>\n<div class=\"alignright\" style=\"margin-left:20px;\"><\/div>\n<div style=\"margin-top:20px; margin-right:30px; margin-bottom:50px;\">\n<p>Although it sounds simple, but it really works. During the system upgrade, the OS may disable some of your daemons. Instead of troubleshooting each one by one, the easiest way is to start everything over. For example, I experienced this problem today after upgrading the <strong>Apache and Ruby<\/strong> (Yes, MySQL is not part of the update), and I got this error message afterward. After rebooting the computer, the error message is gone.\n<\/p>\n<\/div>\n<h2>Solution 2: Remove Your MySQL Config File<\/h2>\n<p>If you have modified your MySQL configuration file, MySQL may not like it few versions after (MySQL is not backward compatibility friendly). It can be the problem of using an unsupported variable, or something similar. The easiest way is to remove your configuration file, and try to start the MySQL server again:<\/p>\n<p>Backup your MySQL configuration first.<\/p>\n<pre>\r\nmv \/etc\/my.cnf \/etc\/my.cnf.backup\r\n<\/pre>\n<p>And restart the MySQL server again:<\/p>\n<pre>\r\n\/usr\/local\/share\/mysql\/mysql.server start\r\n<\/pre>\n<p>Hopefully you will see the following message:<\/p>\n<pre>\r\nStarting MySQL. SUCCESS!\r\n<\/pre>\n<h2>Solution 3: Upgrade Your Database File<\/h2>\n<p>Sometimes, the newer MySQL doesn&#8217;t like the database created in earlier version. I discovered this when I upgrade to MySQL 5.5.7:<\/p>\n<pre>\r\nStarting MySQL..... ERROR! The server quit without updating PID file (\/var\/db\/mysql\/www.icesquare.com.pid).\r\n<\/pre>\n<p>Since MySQL tells me which PID file causes the problem, I open the file and take a look what&#8217;s going on:<\/p>\n<pre>\r\nsudo tail \/var\/db\/mysql\/www.icesquare.com.err\r\n<\/pre>\n<p>And I saw something interesting: <strong>tables: Table &#8216;mysql.proxies_priv&#8217; doesn&#8217;t exist<\/strong>:<\/p>\n<pre>\r\n101112 10:49:16  InnoDB: Initializing buffer pool, size = 128.0M\r\n101112 10:49:16  InnoDB: Completed initialization of buffer pool\r\n101112 10:49:16  InnoDB: highest supported file format is Barracuda.\r\n101112 10:49:17  InnoDB: 1.1.3 started; log sequence number 1589404\r\n101112 10:49:17 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.proxies_priv' doesn't exist\r\n101112 10:49:17 mysqld_safe mysqld from pid file \/var\/db\/mysql\/www.icesquare.com.pid ended\r\n<\/pre>\n<div class=\"alignright\"><\/div>\n<p>\nThe reason is very simple. MySQL could not open a table created in the earlier version (&lt; 5.7.7) because it is not compatible with the current version. So, we can try to start the MySQL in safe mode through rc.d. First, you can edit the <strong>\/etc\/rc.conf<\/strong> and put the following into the file:\n<\/p>\n<pre>\r\nmysql_enable=\"YES\"\r\nmysql_args=\"--skip-grant-tables --skip-networking\"\r\n<\/pre>\n<p>Restart MySQL through rc.d:<\/p>\n<pre>\r\n\/usr\/local\/etc\/rc.d\/mysql-server start\r\n<\/pre>\n<p>If you did it right, you should see something like the following:<\/p>\n<pre>\r\nStarting MySQL.. SUCCESS!\r\n<\/pre>\n<p>Now, MySQL is already running the safe-mode. We want to perform a MySQL upgrade on all tables:<\/p>\n<pre>\r\nsudo mysql_upgrade\r\n<\/pre>\n<p>You should see something like this:<\/p>\n<pre>\r\nLooking for 'mysql' as: mysql\r\nLooking for 'mysqlcheck' as: mysqlcheck\r\nRunning 'mysqlcheck' with connection arguments: '--port=3306' '--socket=\/tmp\/mysql.sock'\r\nRunning 'mysqlcheck' with connection arguments: '--port=3306' '--socket=\/tmp\/mysql.sock'\r\nmysql.columns_priv                                 OK\r\nmysql.db                                           OK\r\nmysql.event                                        OK\r\nmysql.func                                         OK\r\nmysql.general_log                                  OK\r\nmysql.help_category                                OK\r\nmysql.help_keyword                                 OK\r\nmysql.help_relation                                OK\r\nmysql.help_topic                                   OK\r\nmysql.host                                         OK\r\nmysql.ndb_binlog_index                             OK\r\nmysql.plugin                                       OK\r\nmysql.proc                                         OK\r\nmysql.procs_priv                                   OK\r\nmysql.servers                                      OK\r\nmysql.slow_log                                     OK\r\nmysql.tables_priv                                  OK\r\nmysql.time_zone                                    OK\r\nmysql.time_zone_leap_second                        OK\r\nmysql.time_zone_name                               OK\r\nmysql.time_zone_transition                         OK\r\nmysql.time_zone_transition_type                    OK\r\nmysql.user                                         OK\r\nRunning 'mysql_fix_privilege_tables'...\r\nOK\r\n<\/pre>\n<p>Now, we want to switch the MySQL back to normal mode by commenting the extra options in \/etc\/rc.conf:<\/p>\n<pre>\r\nmysql_enable=\"YES\"\r\n#mysql_args=\"--skip-grant-tables --skip-networking\"\r\n<\/pre>\n<p>And restart MySQL through \/etc\/rc.d:<\/p>\n<pre>\/usr\/local\/etc\/rc.d\/mysql-server restart\r\n<\/pre>\n<p>Now the MySQL is up and running again!<\/p>\n<p>Happy MySQLing.<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This step-by-step guide is mainly for FreeBSD, however the idea is the same for Linux. Every once a while, when I update my FreeBSD box, the system likes to shutdown <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_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":[94,144,6,69],"tags":[171,9],"class_list":["post-1028","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-sever-problem","category-technology","category-troubleshooting-technology","tag-freebsd","tag-mysql"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-gA","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":613,"url":"https:\/\/icesquare.com\/wordpress\/starting-mysql-error-the-server-quit-without-updating-pid-file\/","url_meta":{"origin":1028,"position":0},"title":"Starting MySQL.. ERROR! The server quit without updating PID file","author":"Derrick","date":"April 13, 2010","format":false,"excerpt":"This article is a bit outdated. Please visit the following article instead. It includes a better discussion on how to solve this problem using different scenarios: MySQL: Starting MySQL\u2026.. ERROR! The server quit without updating PID file Thanks. --Derrick [ad#ad-bottom]","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3023,"url":"https:\/\/icesquare.com\/wordpress\/freebsdmysql-server-could-not-start\/","url_meta":{"origin":1028,"position":1},"title":"[FreeBSD]MySQL server could not start","author":"Derrick","date":"November 22, 2012","format":false,"excerpt":"Today, I noticed that the MySQL server on my FreeBSD server is down for unknown reason, and today is Thanksgiving. Initially, I tried to restart the MySQL server using the following command, but it didn't help to restart the MySQL: sudo \/usr\/local\/etc\/rc.d\/mysql-server restart and it gives me the following error\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3883,"url":"https:\/\/icesquare.com\/wordpress\/mysql-random-error-error-2013-hy000-lost-connection-to-mysql-server-at-reading-authorization-packet-system-error-0\/","url_meta":{"origin":1028,"position":2},"title":"MySQL Random Error: ERROR 2013 (HY000): Lost connection to MySQL server at &#8216;reading authorization packet&#8217;, system error: 0","author":"Derrick","date":"December 6, 2014","format":false,"excerpt":"Recently, I am experiencing a weird error when connecting to a MySQL server remotely: ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 0 Basically, this error is similar to the busy tone when you are making calls. The key thing is, it happens randomly.\u2026","rel":"","context":"In &quot;Everyday Computer Problem&quot;","block_context":{"text":"Everyday Computer Problem","link":"https:\/\/icesquare.com\/wordpress\/category\/everyday-computer-problem\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":31,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-php-mysql-and-memcached-on-freebsd\/","url_meta":{"origin":1028,"position":3},"title":"Installing Apache, PHP, MySQL and MemCached on FreeBSD","author":"Derrick","date":"May 19, 2009","format":false,"excerpt":"This is my note on how to to install Apache, PHP, MySQL and MemCached on a FreeBSD 7 Box. 1. MySQL Go to the mysql52-server port directory by typing the command: cd \/usr\/ports\/databases\/mysql51-server Build the port by typing: make BUILD_OPTIMIZED=yes BUILD_STATIC=yes Using these two options will speed up the execution\u2026","rel":"","context":"In &quot;FreeBSD&quot;","block_context":{"text":"FreeBSD","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/freebsd\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3474,"url":"https:\/\/icesquare.com\/wordpress\/the-easiest-way-to-improve-the-performance-of-mysql-server-on-freebsd\/","url_meta":{"origin":1028,"position":4},"title":"The easiest way to improve the performance of MySQL server on FreeBSD","author":"Derrick","date":"February 2, 2014","format":false,"excerpt":"There are many different ways to improve the MySQL performance. In general, it breaks down into two different categories: Server side and client side. On the server side, we can optimize the database and table structure, such as indexing the columns etc. On the client side, we can optimize the\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":626,"url":"https:\/\/icesquare.com\/wordpress\/error-2006-hy000-at-line-172-mysql-server-has-gone-away\/","url_meta":{"origin":1028,"position":5},"title":"ERROR 2006 (HY000) at line 172: MySQL server has gone away","author":"Derrick","date":"April 13, 2010","format":false,"excerpt":"Today I imported the MySQL database and I got the following error: # mysql -u root -p db_test < test.db Enter password: ERROR 2006 (HY000) at line XX: MySQL server has gone away It is because the data (SQL query) is too large to imported. To solve this problem, simply\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1028"}],"version-history":[{"count":42,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1028\/revisions"}],"predecessor-version":[{"id":2385,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1028\/revisions\/2385"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}