<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HandsomePlanet &#187; mysql</title>
	<atom:link href="http://www.handsomeplanet.com/archives/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.handsomeplanet.com</link>
	<description>technology and other perplexities</description>
	<lastBuildDate>Sun, 05 Sep 2010 02:26:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Fixing broken mysql / mysql-server under Ubuntu 9.04 (Jaunty) after a purge</title>
		<link>http://www.handsomeplanet.com/archives/38</link>
		<comments>http://www.handsomeplanet.com/archives/38#comments</comments>
		<pubDate>Sat, 13 Jun 2009 00:25:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.handsomeplanet.com/?p=38</guid>
		<description><![CDATA[I broke my server attempting to do some clean-up before making bigger changes.   mysql would not restart, and the culprit was something like  &#8216;apt-get purge mysql-server,&#8217; which deleted the /etc/mysql directory .  Various installs brought back /etc/mysql but without solving the problem: % sudo apt-get install mysql-server mysql-common Setting up mysql-server-5.0 (&#8230;) * Stopping MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>I broke my server attempting to do some clean-up before making bigger changes.   mysql would not restart, and the culprit was something like  &#8216;apt-get purge mysql-server,&#8217; which deleted the /etc/mysql directory .  Various installs brought back /etc/mysql but without solving the problem:</p>
<p>% sudo apt-get install mysql-server mysql-common</p>
<blockquote><p>Setting up mysql-server-5.0 (&#8230;)<br />
* Stopping MySQL database server mysqld                                 [ OK ]<br />
* Starting MySQL database server mysqld                                  [fail]<br />
invoke-rc.d: initscript mysql, action &#8220;start&#8221; failed.<br />
dpkg: error processing mysql-server-5.0 (&#8211;configure):<br />
subprocess post-installation script returned error exit status 1<br />
dpkg: dependency problems prevent configuration of mysql-server:<br />
mysql-server depends on mysql-server-5.0; however:<br />
Package mysql-server-5.0 is not configured yet.<br />
dpkg: error processing mysql-server (&#8211;configure):<br />
dependency problems &#8211; leaving unconfigured<br />
No apport report written because the error message indicates its a followup error from a previous failure.<br />
Errors were encountered while processing:<br />
mysql-server-5.0<br />
mysql-server<br />
E: Sub-process /usr/bin/dpkg returned an error code (1)</p></blockquote>
<blockquote><p>/var/log/dpkg:<br />
2009-06-12 17:23:31 status half-installed mysql-server 5.1.30really5.0.75-0ubuntu10.2</p></blockquote>
<p>In any case, the only way I could get things back running was to copy over the /etc/mysql directory from a working server,  doing</p>
<p>% sudo apt-get remove &#8211;purge mysql-server<br />
% sudo apt-get install mysql-server</p>
<p>and rebooting.</p>
<p>Here&#8217;s what the /etc/mysql directory looked like after the copy:</p>
<p><code>/etc/mysql# ls -l<br />
total 16<br />
drwxr-xr-x 2 root root 4096 2009-06-12 17:23 conf.d<br />
-rw------- 1 root root  312 2009-06-12 17:23 debian.cnf<br />
-rwxr-xr-x 1 root root 1198 2009-05-14 05:39 debian-start<br />
-rw-r--r-- 1 root root 4088 2009-03-30 15:18 my.cnf<br />
/etc/mysql# ls -l conf.d/<br />
total 0</code></p>
<p>So, the copy provided the conf.d directory and the my.cnf file that the re-install failed to (re)create.</p>
<p>I&#8217;ve uploaded a copy of the default Ubuntu 9.04 /etc/mysql/my.cnf file <a title="my.cnf" href="http://www.handsomeplanet.com/wp-content/uploads/2009/06/my.cnf">here</a>.</p>
<p>And here&#8217;s just the active info from my.cnf file<br />
(filtered through <code>egrep -v '^$|^#' my.cnf </code> to remove empty lines and comment lines) :</p>
<p>&#8212;&#8211;start my.cnf&#8212;&#8212;</p>
<p><code> [client]<br />
port        = 3306<br />
socket        = /var/run/mysqld/mysqld.sock<br />
[mysqld_safe]<br />
socket        = /var/run/mysqld/mysqld.sock<br />
nice        = 0<br />
[mysqld]<br />
user        = mysql<br />
pid-file    = /var/run/mysqld/mysqld.pid<br />
socket        = /var/run/mysqld/mysqld.sock<br />
port        = 3306<br />
basedir        = /usr<br />
datadir        = /var/lib/mysql<br />
tmpdir        = /tmp<br />
skip-external-locking<br />
bind-address        = 127.0.0.1<br />
key_buffer        = 16M<br />
max_allowed_packet    = 16M<br />
thread_stack        = 128K<br />
thread_cache_size    = 8<br />
myisam-recover        = BACKUP<br />
query_cache_limit       = 1M<br />
query_cache_size        = 16M<br />
expire_logs_days    = 10<br />
max_binlog_size         = 100M<br />
skip-federated<br />
[mysqldump]<br />
quick<br />
quote-names<br />
max_allowed_packet    = 16M<br />
[mysql]<br />
[isamchk]<br />
key_buffer        = 16M<br />
!includedir /etc/mysql/conf.d/</code></p>
<p>&#8212;&#8211;end my.cnf&#8212;&#8212;</p>
<p>Recreating that file may help you get mysql back running, as it appears to have been essential for me.</p>
<p>Incidentally, here is a handy search for printing which logfiles have info about your misbehaving program (in this case, mysql):</p>
<p><code>/var/log# egrep mysql * | awk -F: '{print $1}' | uniq</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.handsomeplanet.com/archives/38/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
