<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The eternal fight between admins and computers</title>
	<atom:link href="http://anothersysadmin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://anothersysadmin.wordpress.com</link>
	<description>(and very often users, as well)</description>
	<lastBuildDate>Thu, 19 Nov 2009 12:05:01 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='anothersysadmin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/66ef3cf705321e471c2ca5ba7285fae3?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>The eternal fight between admins and computers</title>
		<link>http://anothersysadmin.wordpress.com</link>
	</image>
			<item>
		<title>pbzip2: parallel bzipping</title>
		<link>http://anothersysadmin.wordpress.com/2009/11/18/pbzip2-parallel-bzipping/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/11/18/pbzip2-parallel-bzipping/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 17:35:20 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[copmpression]]></category>
		<category><![CDATA[optimizations]]></category>
		<category><![CDATA[smp]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=244</guid>
		<description><![CDATA[Probably this software existed for a quite long time but I didn&#8217;t know its existence &#8217;til now: pbzip2
it&#8217;s basically a bzip2 algorithm implementation with pthreads support. This mean, in a always more SMP world, that you can greatly improve your bzipping perfomances (divide the zipping time by the number of cores you have et voilà!)
Compression [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=244&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Probably this software existed for a quite long time but I didn&#8217;t know its existence &#8217;til now: <a href="http://compression.ca/pbzip2/">pbzip2</a><br />
it&#8217;s basically a bzip2 algorithm implementation with pthreads support. This mean, in a always more SMP world, that you can greatly improve your bzipping perfomances (divide the zipping time by the number of cores you have et voilà!)</p>
<p>Compression syntax is totally compatible:<br />
<code><br />
$ pbzip2 big.file<br />
</code></p>
<p>while to unzip you have to do<br />
<code><br />
$ pbzip2 -d big.file.bz2<br />
</code></p>
<p>Use with caution (or with -l and -p switches) cause you can easily saturate your 4xSix-cores monster.</p>
Posted in Linux, Performance, Tips, Unix  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/244/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=244&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/11/18/pbzip2-parallel-bzipping/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>HOWTO: Ethernet bonding in Debian Lenny</title>
		<link>http://anothersysadmin.wordpress.com/2009/11/06/howto-ethernet-bonding-in-debian-lenny/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/11/06/howto-ethernet-bonding-in-debian-lenny/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 10:53:21 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[bonding]]></category>
		<category><![CDATA[lenny]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=241</guid>
		<description><![CDATA[In an older post I explained how to create a bond interface in Debian Etch&#8230; now, this doesn&#8217;t work anymore due to some changes in Lenny. 
So, long story short, first of all, install ifenslave

# apt-get install ifenslave-2.6

edit /etc/network/interfaces and add the bond0 config:

auto bond0
iface bond0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=241&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In an older post I explained <a href="http://anothersysadmin.wordpress.com/2007/10/02/ethernet-bonding-in-debian/">how to create a bond interface in Debian Etch</a>&#8230; now, this doesn&#8217;t work anymore due to some changes in Lenny. </p>
<p>So, long story short, first of all, install ifenslave<br />
<code><br />
# apt-get install ifenslave-2.6<br />
</code></p>
<p>edit <code>/etc/network/interfaces</code> and add the bond0 config:<br />
<code><br />
auto bond0<br />
iface bond0 inet static<br />
address 192.168.1.2<br />
netmask 255.255.255.0<br />
network 192.168.1.0<br />
broadcast 192.168.1.255<br />
gateway 192.168.1.1<br />
# dns-* options are implemented by the resolvconf package, if installed<br />
dns-nameservers 192.168.1.1<br />
up /sbin/ifenslave bond0 eth0 eth1<br />
down /sbin/ifenslave -d bond0 eth0 eth1<br />
</code></p>
<p>now edit <code>/etc/modprobe.d/arch/x86_64</code> (change the filename depending on your architecture) and add these lines</p>
<p><code><br />
alias bond0 bonding<br />
options bonding mode=1 miimon=100 downdelay=200 updelay=200<br />
</code></p>
<p>Brief explanation:</p>
<ul>
<li><b>miimon N</b>: check if the active interface(s) is alive every N milliseconds</li>
<li><b>downdelay N</b>: wait N milliseconds after a detected link failure to consider the link down</li>
<li><b>updelay N</b>: wait N milliseconds after a detected link restoration to consider the link up</li>
<li><b>mode N</b>: 1 means master/slave configuration, so there&#8217;s only one active master. If this link fails, then slave is used.</li>
</ul>
<p>For a more complete description of all the possible parameters, refer to Linux <a href="http://kernel.org/doc/Documentation/networking/bonding.txt">Documentation/networking/bonding.txt</a></p>
<p>After this, you can restart networking or reboot if you are working remotely and it should work without a problem. It did for me :)</p>
Posted in Debian, Howtos, Linux, Networking  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/241/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=241&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/11/06/howto-ethernet-bonding-in-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>Column names with trailing spaces in tables and views</title>
		<link>http://anothersysadmin.wordpress.com/2009/11/04/column-names-with-trailing-spaces-in-tables-and-views/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/11/04/column-names-with-trailing-spaces-in-tables-and-views/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 16:58:41 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=237</guid>
		<description><![CDATA[Just found out a bizarre feature of MySQL: you simply cannot create a table with a trailing space in a column name. Something like this, doesn&#8217;t work:

create table a (`a ` int);
ERROR 1166 (42000): Incorrect column name 'a '

There&#8217;s a thread in MySQL&#8217;s lists explaining it
Ok, it seems there&#8217;s a technical limitation but this solution [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=237&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Just found out a bizarre feature of MySQL: you simply cannot create a table with a trailing space in a column name. Something like this, doesn&#8217;t work:<br />
<code><br />
create table a (`a ` int);<br />
ERROR 1166 (42000): Incorrect column name 'a '<br />
</code></p>
<p>There&#8217;s <a href="http://lists.mysql.com/internals/36886">a thread in MySQL&#8217;s lists explaining it</a></p>
<p>Ok, it seems there&#8217;s a technical limitation but this solution seems like a lazy workaround to me.<br />
The problem is with CREATE VIEW. In <b>recent MySQL builds</b> you cannot either create a view with a trailing space in a column name. But <b>recent</b> means, at least, greater than 5.0.51a, cause this version DOES let you create a view with a trailing space.<br />
<code><br />
# mysql --version<br />
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2</p>
<p>mysql&gt; create view b as select a `a ` from a;<br />
Query OK, 0 rows affected (0.00 sec)<br />
</code></p>
<p>There&#8217;s a big problem here: 5.0.51a is the default and supported version in Debian Lenny! So, if you have Lenny as a master of a more recent MySQL installation, be careful cause a CREATE VIEW with a trailing space in a column name will break your replication. Grrrr. MySQL, I hate you, really.</p>
Posted in Debian, Linux, Mysql, Rants  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/237/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=237&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/11/04/column-names-with-trailing-spaces-in-tables-and-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL slaves and the &#8220;corrupted&#8221; relay log/binlog problem</title>
		<link>http://anothersysadmin.wordpress.com/2009/10/28/mysql-slaves-and-the-corrupted-relay-log-problem/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/10/28/mysql-slaves-and-the-corrupted-relay-log-problem/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 12:02:02 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=232</guid>
		<description><![CDATA[When trying to pull up to date a new slave, maybe using a binlog server (a MySQL server with no true tablespace, just acting as master for slaves, feeding them with replication data), you may encounter an error like this in your mysql.err file, after noticing the replication has just broken

091028 11:32:49 [ERROR] Slave SQL: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=232&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When trying to pull up to date a new slave, maybe using a <em>binlog server</em> (a MySQL server with no true tablespace, just acting as master for slaves, feeding them with replication data), you may encounter an error like this in your mysql.err file, after noticing the replication has just broken<br />
<code><br />
091028 11:32:49 [ERROR] Slave SQL: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 1594<br />
091028 11:32:49 [Warning] Slave: Field 'owner' doesn't have a default value Error_code: 1364<br />
091028 11:32:49 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysqld-bin.000780' position 786513508<br />
</code></p>
<p>Well, everything on the web points to a &#8220;OMG, my file is corrupt!! My disk is freaking out!&#8221;. Probably, instead, it&#8217;s just simpler: <strong>you have forgotten a <code>FLUSH LOGS;</code> before backing up your binary logs from the original master</strong>. So, when you are recreating the binlog server from the backup, the final slave arrives to the last statement wich obviously is not complete/correct and booom, it stops.</p>
<p>The solution is to copy the correct and complete binlog file (in my case mysqld-bin.000780) again in the binlog server, then issue a<br />
<code>STOP SLAVE;<br />
CHANGE MASTER TO  master_log_file="mysqld-bin.000780", master_log_pos=786513508;<br />
SLAVE START;<br />
</code></p>
<p>and&#8230; problem solved!<br />
(remember to adjust file name and position to suite your needs)</p>
<p>Lesson learned (once again): always test your backups and do not hesitate to flush with MySQL :)</p>
Posted in Linux, Mysql, Tips  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/232/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=232&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/10/28/mysql-slaves-and-the-corrupted-relay-log-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>HOWTO: Install Mysql 5.1 for SPARC64 under Debian Lenny</title>
		<link>http://anothersysadmin.wordpress.com/2009/08/06/howto-install-mysql-5-1-for-sparc64-under-debian-lenny/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/08/06/howto-install-mysql-5-1-for-sparc64-under-debian-lenny/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 16:22:19 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[sparc]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=216</guid>
		<description><![CDATA[If you happen to own a SPARC64 box, you&#8217;ll probably already know that even if the kernel is 64bit the userland comes from the normal SPARC Debian port, so it&#8217;s 32bit. Mysql is no exception, with all the 32bit limitations &#8211; mainly the 4GB RAM per process limit.
This is really  a PITA because if you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=216&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you happen to own a SPARC64 box, you&#8217;ll probably already know that even if the kernel is 64bit the userland comes from the normal SPARC Debian port, so it&#8217;s 32bit. Mysql is no exception, with all the 32bit limitations &#8211; mainly the 4GB RAM per process limit.</p>
<p>This is really  a PITA because if you have a SPARC64 box probably it has got plenty of RAM and you want to use it at its full potential, without having to messing around with Solaris (yeah, I don&#8217;t like it very much, I&#8217;m sorry).</p>
<p>This guide covers Mysql 5.1 installation in Debian Lenny, so we have to use SID repositories.</p>
<p><code><br />
# echo "deb http://ftp.de.debian.org/debian/ sid main" &gt;&gt; /etc/apt/sources.list<br />
# echo "deb-src http://ftp.de.debian.org/debian/ sid main" &gt;&gt; /etc/apt/sources.list<br />
</code></p>
<p>then let&#8217;s edit our apt preferences to avoid massive update on next dist-upgrade :)<br />
<code><br />
# vim /etc/apt/preferences<br />
Package: *<br />
Pin: release a=stable<br />
Pin-Priority: 900<br />
Package: *<br />
Pin: release a=sid<br />
Pin-Priority: 100<br />
</code></p>
<p>and then update our repo list<br />
<code><br />
# aptitude update<br />
</code></p>
<p>And here we go:<br />
<code><br />
# apt-get build-dep mysql-server-5.1<br />
# mkdir /tmp/mysql-build; cd /tmp/mysql-build<br />
# apt-get source mysql-server-5.1<br />
# vim mysql-dfsg-5.1*/debian/rules<br />
</code></p>
<p>here we touch a little the rules for compiling cause there are a couple of things that are not going to work by default.</p>
<p>The MAKE_J variable doesn&#8217;t work very well, so you can modify the grep to look for &#8220;CPU&#8221; instead of &#8220;processor&#8221; or you could hardcode it to the number of processor you have. This will make compilation <b>a lot faster</b>.<br />
<code><br />
MAKE_J = -j$(shell if [ -f /proc/cpuinfo ] ; then grep -c CPU* /proc/cpuinfo ; else echo 1 ; fi)<br />
</code></p>
<p>then edit the CFLAGS variable because it&#8217;s used to compile some library that will ignore the environment variables we are going to set later in this howto.<br />
<code><br />
CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O3 -DBIG_JOINS=1 -m64 -mcpu=niagara2 ${FORCE_FPIC_CFLAGS}"} \<br />
</code><br />
it should be about line 73. Please note that -m64 will make it 64bit so it&#8217;s mandatory while the mcpu flag it&#8217;s to optimize the executable for your CPU. In my case it&#8217;s a niagara2 chip but you can use another CPU as well. <a href="http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html">Check the GCC documentation</a> for more details<br />
Save and quit and then we can start with the compilation process:<br />
<code><br />
# export CFLAGS="-m64 -mcpu=niagara2 -O2 -g"<br />
# export CXXFLAGS="-m64 -mcpu=niagara2 -O2 -g"<br />
# export CPPFLAGS="-m64 -mcpu=niagara2 -O2 -g"<br />
# export LDFLAGS="-m64 -mcpu=niagara2 -O2 -g"<br />
# export DEB_BUILD_OPTIONS="nocheck"<br />
# debuild -us -uc --preserve-env<br />
</code></p>
<p>that&#8217;s it. After some minutes (depending on your HW), you should have in /tmp/mysql-build all your new DEBs which you can install with dpkg -i. I advice to install the stock mysql-server-5.1 with aptitude before to get all dependencies installed, then you can use dpkg with your new DEBs.</p>
Posted in Debian, Howtos, Linux, Mysql  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/216/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=216&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/08/06/howto-install-mysql-5-1-for-sparc64-under-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>Using tee to redirect output to multiple programs</title>
		<link>http://anothersysadmin.wordpress.com/2009/06/08/using-tee-to-redirect-output-to-multiple-programs/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/06/08/using-tee-to-redirect-output-to-multiple-programs/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 07:44:50 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oneliner]]></category>
		<category><![CDATA[Shell scripts]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=202</guid>
		<description><![CDATA[Via http://linux.byexamples.com/archives/144/redirect-output-to-multiple-processes/
You already know that if you want to pass the output of a program to the input of another program, you can use the pipe &#124; character.
You now that if you want to write the ouput of a program to the disk and at the same time pass it as input to another program, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=202&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Via <a href="http://linux.byexamples.com/archives/144/redirect-output-to-multiple-processes/" target="_blank">http://linux.byexamples.com/archives/144/redirect-output-to-multiple-processes/</a></p>
<p>You already know that if you want to pass the output of a program to the input of another program, you can use the pipe | character.</p>
<p>You now that if you want to write the ouput of a program to the disk and at the same time pass it as input to another program, you can use tee.</p>
<p>But maybe you don&#8217;t know that if you want to pass the ouput of a program to multiple programs as input, you can use tee again with a little of subshelling.</p>
<pre># source_program | tee (&gt; program1) (&gt; program2) (&gt; programN)| programN+1</pre>
Posted in Linux, Oneliner, Shell scripts, Tips, Unix  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=202&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/06/08/using-tee-to-redirect-output-to-multiple-programs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>HOWTO: install Transifex with Mysql on Debian Lenny</title>
		<link>http://anothersysadmin.wordpress.com/2009/06/04/howto-install-transifex-with-mysql-on-debian-lenny/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/06/04/howto-install-transifex-with-mysql-on-debian-lenny/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 16:04:41 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=204</guid>
		<description><![CDATA[Transifex is a not-so-well-known opensource localization platform, written in Python and running on Django (a Python based application server, if you don&#8217;t know it). So, being not so well known, there isn&#8217;t a lot of documentation about it, and how to install it under Debian 5 Lenny it&#8217;s almost undocumented. So, here we go.
First of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=204&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a title="transifex.org" href="http://www.transifex.org/" target="_blank">Transifex</a> is a not-so-well-known opensource localization platform, written in Python and running on Django (a Python based application server, if you don&#8217;t know it). So, being not so well known, there isn&#8217;t a lot of <a title="Transifex quick install guide" href="http://docs.transifex.org/intro/install.html" target="_blank">documentation</a> about it, and how to install it under Debian 5 Lenny it&#8217;s almost undocumented. So, here we go.</p>
<p>First of all, you have to install some packages. Luckily Lenny has got lot of them, although not all the needed</p>
<pre># aptitude install django python-urlgrabber python-setuptools python-pygments python-openid python-markdown python-httplib2
# aptitude install subversion
# aptitude install python-mysqldb
# aptitude install build-essential python-dev</pre>
<p>These should be all the packages needed by Transifex which are available as deb packages. Now let&#8217;s install the remaining ones through easy_install</p>
<pre># easy_install django-authopenid django-pagination
# easy_install -f http://transifex.org/files/eggs/ contact_form tagging
# easy_install django-notification
# easy_install mercurial</pre>
<p>Now the last package, django_evolution which is, AFAIK, only available as an SVN checkout from <a title="Django Evolution" href="http://code.google.com/p/django-evolution/" target="_blank">Google Code</a></p>
<pre># svn checkout http://django-evolution.googlecode.com/svn/trunk /tmp/django-evol
# mv /tmp/django-evol/django_evolution /usr/lib/python2.5/site-packages/</pre>
<p>Now we can download the Transifex tarball</p>
<pre># cd /tmp &amp;&amp; wget http://transifex.org/files/transifex-0.6.tar.gz
# tar xzvf transifex-0.6.tar.gz
# cp -a transifex-0.6/transifex /var/www</pre>
<p>Now we have to edit some configuration files located in /var/www/transifex/settings with particular attention to the database backend configuration stored in 20-engines.conf. Take this as example</p>
<pre>DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'transifex'
DATABASE_USER = 'transifex'
DATABASE_PASSWORD = 'secret_password'
DATABASE_HOST = 'ADDRESS-OF-YOUR-DB'             # Set to empty string for local socket
DATABASE_PORT = '3306'             # Set to empty string for default</pre>
<p>obviously you must create a database (called &#8216;transifex&#8217; in this example) in your database server and give full permissions to a dedicated user (called &#8216;transifex&#8217; with &#8217;secret_password&#8217; as password in this example). You can do it with these commands in your mysql console:</p>
<pre>CREATE DATABASE transifex;
GRANT ALL ON transifex.* to 'transifex'@'%' IDENTIFIED BY 'secret_password';</pre>
<p>Now we can run the configuration scripts, located in the transifex&#8217;s base dir</p>
<pre># cd /var/www/transifex
# ./manage.py syncdb
# ./manage.py txcreatedirs
# ./manage.py runserver</pre>
<p>Now we can execute a server instance, listening on address $IPADDRESS and port 8088,  and then we can access it fro http://$IPADDRESS:8088 in our web browser. Remember to use nohup if yoiu want to detach it from the console</p>
<pre># ./manage.py $IPADDRESS:8088</pre>
Posted in Debian, Howtos, Linux  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=204&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/06/04/howto-install-transifex-with-mysql-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu 9.04 and UXA acceleration in X.Org</title>
		<link>http://anothersysadmin.wordpress.com/2009/05/05/ubuntu-904-and-uxa-acceleration-in-xorg/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/05/05/ubuntu-904-and-uxa-acceleration-in-xorg/#comments</comments>
		<pubDate>Tue, 05 May 2009 07:54:12 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[X.Org]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=195</guid>
		<description><![CDATA[With the recent release of Ubuntu 9.04 and the brand new X.org stack, finally I have got quick and usable windows effects in my KDE 4.2 install (using Kwin, not Compiz).
My workstation is a Dell Optiplex 745 with an Intel grapphic chipset
$ lspci&#124;grep -i vga
00:02.0 VGA compatible controller: Intel Corporation 82Q963/Q965 Integrated Graphics Controller (rev [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=195&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>With the recent release of Ubuntu 9.04 and the brand new X.org stack, finally I have got quick and usable windows effects in my KDE 4.2 install (using Kwin, not Compiz).<br />
My workstation is a Dell Optiplex 745 with an Intel grapphic chipset</p>
<p><code>$ lspci|grep -i vga<br />
00:02.0 VGA compatible controller: <strong>Intel Corporation 82Q963/Q965 Integrated Graphics</strong> Controller (rev 02)</code></p>
<p>with the default install I had serious problems with X, and with serious I mean textures corruptions, artifacts with KDE/Qt4 applications and all sort of graphic glitches.. really a PITA. Then the great idea: Ubuntu 9.04 now ships with a DRI2 enabled kernel, GEM for graphic memory management and this new Intel-sponsored acceleration framework called UXA, which is supposed to improve XAA and EXA. So, if everything is already screwed, why not give it a try?</p>
<p>So I fired up my vim editor and changed my <code>/etc/X11/xorg.conf</code> to look <strong>exactly</strong> like this, no more no less:</p>
<pre>Section "Monitor"
 Identifier      "Configured Monitor"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
EndSection</pre>
<pre>Section "Device"
        Identifier      "Configured Video Device"
        Option          "AccelMethod" "UXA"
EndSection</pre>
<pre>Section "ServerFlags"
        Option  "DontZap"       "False"
EndSection</pre>
<p>restarted X and the magic was done. I activated the composited effects in KWin and everything worked like a charm, really flying as it never did and as it is supposed to do (Vista on the same hardware works the same).<br />
So, if you have a similar hardware, I encourage you to try the same. If anything goes wrong, removing this line<br />
<code><br />
Option          "AccelMethod" "UXA"<br />
</code><br />
will fall back the configuration to its default state.</p>
<p>HTH</p>
Posted in Desktop, Tips, Ubuntu, X.Org  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=195&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/05/05/ubuntu-904-and-uxa-acceleration-in-xorg/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>Disable MOTD at login with .hushlogin</title>
		<link>http://anothersysadmin.wordpress.com/2009/03/10/disable-motd-at-login-with-hushlogin/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/03/10/disable-motd-at-login-with-hushlogin/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 11:39:42 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Oneliner]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=192</guid>
		<description><![CDATA[If you want to disable the nice Message of the Day (MotD) your sysadmin gently shows you evry time you login in your remote shell, then all you have to do is just create a zero-lenght (as in empty) file in your $HOME called .hushlogin

&#62; ~/.hushlogin

(you can use touch as well, or any other mean)
That&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=192&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you want to disable the nice Message of the Day (MotD) your sysadmin gently shows you evry time you login in your remote shell, then all you have to do is just create a zero-lenght (as in empty) file in your $HOME called .hushlogin</p>
<blockquote><p>
&gt; ~/.hushlogin
</p></blockquote>
<p>(you can use touch as well, or any other mean)<br />
That&#8217;s all</p>
Posted in Oneliner, Tips, Unix  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/192/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=192&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/03/10/disable-motd-at-login-with-hushlogin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
		<item>
		<title>Mysql and integers: INT, TINYINT and all that jazz</title>
		<link>http://anothersysadmin.wordpress.com/2009/02/11/mysql-and-integers-int-tinyint-and-all-that-jazz/</link>
		<comments>http://anothersysadmin.wordpress.com/2009/02/11/mysql-and-integers-int-tinyint-and-all-that-jazz/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 15:31:52 +0000</pubDate>
		<dc:creator>Vide</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://anothersysadmin.wordpress.com/?p=184</guid>
		<description><![CDATA[Today I stumbled on a discussion here where I work about what&#8217;s the best INT field in Mysql to represent boolean values and about what&#8217;s the real meaning of the *INT(number) definition.
So, I ended looking in the online Mysql manual for answer but also in the &#8220;High Performance MySQL 2nd edition&#8221; written by worldwide-fame MySQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=184&subd=anothersysadmin&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I stumbled on a discussion here where I work about what&#8217;s the best INT field in Mysql to represent boolean values and about what&#8217;s the real meaning of the *INT(number) definition.</p>
<p>So, I ended looking in the online Mysql manual for answer but also in the &#8220;<a href="http://www.amazon.com/High-Performance-MySQL-Optimization-Replication/dp/0596101716/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1234362066&amp;sr=8-1">High Performance MySQL 2nd edition</a>&#8221; written by worldwide-fame MySQL hackers (and published by O&#8217;Really).</p>
<p>To resume, as <a href="http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html">Mysql Manual says</a>: BOOLEAN is an alias for TINYINT(1), so you can use both, although BIT could be a better suited solution.</p>
<p>But what about the parenthesis thingie? Here there are two different opinions on the matter. According to High Performance Mysql&#8217;s authors (page 82, emphasis&#8217; mine):</p>
<blockquote><p>
MySQL lets you specify a &#8220;width&#8221; for integer types, such as INT(11). <strong>This is meaningless for most applications</strong>: it does not restrict the legal range of values, but simply specifies the number of characters MySQL&#8217;s interactive tools (such as commandline client) will reserve for display purposes. <strong>For storage and computational purposes, INT(1) is identical to INT(20)</strong></p></blockquote>
<p>but now let&#8217;s look at<a href="http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html"> this other page in Mysql Manual</a> (emphasis mine):</p>
<blockquote><p>
When used in conjunction with the optional extension attribute ZEROFILL, the default padding of spaces is replaced with zeros. For example, for a column declared as INT(5) ZEROFILL, a value of 4 is retrieved as 00004. <strong>Note that if you store larger values than the display width in an integer column, you may experience problems when MySQL generates temporary tables for some complicated joins, because in these cases MySQL assumes that the data fits into the original column width</strong>. </p></blockquote>
<p>Now&#8230;who&#8217;s right? I use to trust in the <a href="http://www.mysqlperformanceblog.com/">Percona</a> &amp; OpenQuery crew but anyway the official Mysql Manual seems pretty clear about some cases in which the INT(x) value is important.<br />
Any idea?</p>
Posted in Linux, Mysql, Performance, Tips, Unix  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anothersysadmin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anothersysadmin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anothersysadmin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anothersysadmin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anothersysadmin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anothersysadmin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anothersysadmin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anothersysadmin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anothersysadmin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anothersysadmin.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anothersysadmin.wordpress.com&blog=1310142&post=184&subd=anothersysadmin&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anothersysadmin.wordpress.com/2009/02/11/mysql-and-integers-int-tinyint-and-all-that-jazz/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7f83c5c93a8db32d512fd36bc4c99768?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Vide</media:title>
		</media:content>
	</item>
	</channel>
</rss>