{"id":3023,"date":"2012-11-22T12:18:24","date_gmt":"2012-11-22T18:18:24","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=3023"},"modified":"2014-07-06T18:42:07","modified_gmt":"2014-07-06T23:42:07","slug":"freebsdmysql-server-could-not-start","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/freebsdmysql-server-could-not-start\/","title":{"rendered":"[FreeBSD]MySQL server could not start"},"content":{"rendered":"<p>Today, I noticed that the MySQL server on my FreeBSD server is down for unknown reason, and today is Thanksgiving. <\/p>\n<div style=\"margin-bottom:30px;\"><\/div>\n<p>Initially, I tried to restart the MySQL server using the following command, but it didn&#8217;t help to restart the MySQL:<\/p>\n<pre>\r\nsudo \/usr\/local\/etc\/rc.d\/mysql-server restart\r\n<\/pre>\n<p>and it gives me the following error message:<\/p>\n<pre>\r\nmysql not running? (check \/var\/db\/mysql\/icesquare.com.pid).\r\n<\/pre>\n<p>That&#8217;s interesting. So I check the pid file and I found that it is not available. After scratching my head for a while, I noticed one thing:<\/p>\n<pre>\r\ndf\r\n<\/pre>\n<pre>\r\nFilesystem     Size    Used   Avail Capacity  Mounted on\r\n\/dev\/ad4s1d    7.7G    7.7G     -1M   100%    \/var\r\n<\/pre>\n<p>Obviously, the \/var directory is full. No wonder why the MySQL could not create any file, which explains why it stopped working.<\/p>\n<p>Since the server is already up and running, it will be too late to increase the size of \/var without reinstalling the entire system. The simplest way is to soft link the \/var directory to somewhere else. Since a lot of system applications depends on \/var, I don&#8217;t want to move the entire \/var into a different places. So I decide to softlink \/var\/log into \/usr\/var\/log.<\/p>\n<p>The steps are easy:<\/p>\n<pre>\r\nsudo su\r\nmkdir -p \/usr\/var\/\r\nmv \/var\/log \/usr\/var\/\r\nln -s \/usr\/var\/log \/var\/\r\n<\/pre>\n<p>To verify your work, it should look something like that:<\/p>\n<pre>\r\nls \/var\r\n<\/pre>\n<pre>\r\nlrwxr-xr-x   1 root    wheel       13B Nov 22 11:48 log -> \/usr\/var\/log\/\r\n<\/pre>\n<pre>\r\ndf\r\n<\/pre>\n<pre>\r\nFilesystem     Size    Used   Avail Capacity  Mounted on\r\n\/dev\/ad4s1d    7.7G    1.1G    6.0G    15%    \/var\r\n<\/pre>\n<p>Now, if you try to start the MySQL server again, it may or may not work. If you experience any difficulties, try to reboot the server. After the server is reboot, MySQL should be up and running again.<\/p>\n<p>Lesson learned: Always create single partition. \ud83d\ude42<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/freebsdmysql-server-could-not-start\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","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":true,"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,7,144,6,69],"tags":[171,9],"class_list":["post-3023","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-freebsd","category-sever-problem","category-technology","category-troubleshooting-technology","tag-freebsd","tag-mysql"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-ML","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1028,"url":"https:\/\/icesquare.com\/wordpress\/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file\/","url_meta":{"origin":3023,"position":0},"title":"MySQL: Starting MySQL&#8230;.. ERROR! The server quit without updating PID file","author":"Derrick","date":"November 12, 2010","format":false,"excerpt":"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\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":3474,"url":"https:\/\/icesquare.com\/wordpress\/the-easiest-way-to-improve-the-performance-of-mysql-server-on-freebsd\/","url_meta":{"origin":3023,"position":1},"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":613,"url":"https:\/\/icesquare.com\/wordpress\/starting-mysql-error-the-server-quit-without-updating-pid-file\/","url_meta":{"origin":3023,"position":2},"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":31,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-php-mysql-and-memcached-on-freebsd\/","url_meta":{"origin":3023,"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":626,"url":"https:\/\/icesquare.com\/wordpress\/error-2006-hy000-at-line-172-mysql-server-has-gone-away\/","url_meta":{"origin":3023,"position":4},"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":[]},{"id":603,"url":"https:\/\/icesquare.com\/wordpress\/weird-php-error-after-freebsd-port-upgrade\/","url_meta":{"origin":3023,"position":5},"title":"Weird PHP Error after FreeBSD port upgrade (PHP Warning:  PHP Startup: Unable to load dynamic library)","author":"Derrick","date":"April 6, 2010","format":false,"excerpt":"Today I upgraded the port on my FreeBSD box using portmaster tools: portmaster -Dai After that, I found that the PHP gave the following weird error: php -v PHP Warning: PHP Startup: Unable to load dynamic library '\/usr\/local\/lib\/php\/20060613\/memcached.so' - \/usr\/local\/lib\/php\/20060613\/memcached.so: Undefined symbol \" php_session_create_id\" in Unknown on line 0 PHP\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\/3023","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=3023"}],"version-history":[{"count":13,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/3023\/revisions"}],"predecessor-version":[{"id":3661,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/3023\/revisions\/3661"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}