<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:dtvmedia="http://participatoryculture.org/RSSModules/dtv/1.0"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>theMySQLGuy Podcast</title>
	<link>http://www.themysqlguy.com</link>
	<description>Welcome to the theMySQLguy.com podcast.  This is where you can get all kinds of useful information about MySQL.  We will cover intermediate to advanced issues.  So the assumption is that you have MySQL installed and running.</description>
	<pubDate>Thu, 15 Nov 2007 15:00:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
		<!-- podcast_generator="podPress/8.5" -->
		<copyright>&#xA9;Christos Kalantzis </copyright>
		<itunes:new-feed-url>http://www.themysqlguy.com/?feed=podcast</itunes:new-feed-url>
		<managingEditor>christos@themysqlguy.com (Christos Kalantzis) (Christos Kalantzis)</managingEditor>
		<webMaster>christos@themysqlguy.com (Christos Kalantzis)</webMaster>
		<category>Technology:Database</category>
		<ttl>1440</ttl>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>Welcome to the theMySQLguy.com podcast.  This is where you can get all kinds of useful information about MySQL.  We will cover intermediate to advanced issues.  So the assumption is that you have MySQL installed and running.</itunes:summary>
		<itunes:author>Christos Kalantzis</itunes:author>
		<itunes:category text="Technology">
  <itunes:category text="Software How-To"/>
</itunes:category>
<itunes:category text="Technology"/>
		<itunes:owner>
			<itunes:name>Christos Kalantzis</itunes:name>
			<itunes:email>christos@themysqlguy.com (Christos Kalantzis)</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.themysqlguy.com//wp-content/uploads/theMySQLGuySquare300.jpg" />
		<image>
			<url>http://www.themysqlguy.com//wp-content/uploads/theMySQLGuySquare144.jpg</url>
			<title>theMySQLGuy Podcast</title>
			<link>http://www.themysqlguy.com</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Episode 6 - SolidDB Storage Engine</title>
		<link>http://www.themysqlguy.com/?p=15</link>
		<comments>http://www.themysqlguy.com/?p=15#comments</comments>
		<pubDate>Thu, 15 Nov 2007 01:56:27 +0000</pubDate>
		<dc:creator>Christos Kalantzis</dc:creator>
		
		<category><![CDATA[Episodes]]></category>

		<category><![CDATA[innodb]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[soliddb]]></category>

		<guid isPermaLink="false">http://www.themysqlguy.com/?p=15</guid>
		<description><![CDATA[

Recently we ran into a wall in one of my customers&#8217; sites.  They built an application that processed EDI documents.  Each document, contained a list of transactions.  Their application would launch a thread for each transaction in the document.  On the surface this sounds good and the multi-threaded approach would speed [...]]]></description>
			<content:encoded><![CDATA[<h3></h3>
<p align="center"><img src="http://themysqlguy.com/wp-content/uploads/2007/11/logo_solidtech.gif" height="71" width="221" /></p>
<p>Recently we ran into a wall in one of my customers&#8217; sites.  They built an application that processed EDI documents.  Each document, contained a list of transactions.  Their application would launch a thread for each transaction in the document.  On the surface this sounds good and the multi-threaded approach would speed up processing of a document.</p>
<p>InnoDB is the only built-in transactional storage engine and unfortunately has some limitations.</p>
<pre>TX1 SET TRANSACTION ISOLATION LEVEL READ COMMITTED
TX2 SET TRANSACTION ISOLATION LEVEL READ COMMITTED
TX1 START TRANSACTION
TX2 START TRANSACTION
TX1 INSERT INTO child
TX2 INSERT INTO child (with same parent)
TX1 UPDATE parent
TX2 UPDATE parent (same parent row)</pre>
<pre>ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction</pre>
<p>We solved this issue using  a third party storage engine; <a href="http://www.solidtech.com" title="solidDB" target="_blank">solidDB</a>.</p>
<p><a href="http://solutions.mysql.com/solutions/?type=29" target="_blank">Other storage engines available with MySQL</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.themysqlguy.com/?feed=rss2&amp;p=15</wfw:commentRss>
			<enclosure url="http://themysqlguy.com/wp-content/uploads/episodes/episode_06.mp3" length="4220299" type="audio/mpeg"/>
<itunes:duration>8:47</itunes:duration>
		<itunes:subtitle>Episode 6 - SolidDB</itunes:subtitle>
		<itunes:summary>Episode 6 - SolidDB</itunes:summary>
		<itunes:keywords>Episodes</itunes:keywords>
		<itunes:author>Christos Kalantzis</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>No</itunes:block>
	</item>
		<item>
		<title>Episode 5 - Federated Storage Engine</title>
		<link>http://www.themysqlguy.com/?p=14</link>
		<comments>http://www.themysqlguy.com/?p=14#comments</comments>
		<pubDate>Tue, 19 Jun 2007 21:48:06 +0000</pubDate>
		<dc:creator>Christos Kalantzis</dc:creator>
		
		<category><![CDATA[Episodes]]></category>

		<guid isPermaLink="false">http://www.themysqlguy.com/?p=14</guid>
		<description><![CDATA[

&#160;
&#160;
&#160;
Federated Storage Engine (FSE) allows you to connect to a remote server and &#8220;mount&#8221; a table on your local server, which links to the data on the remote server, for read-only access.
&#160;
$ mysql -u root -ppassword -h remote

mysql&#62; CREATE DATABASE test;

mysql&#62; use test;

mysql&#62; CREATE TABLE drivers (id INT,name VARCHAR(100));

mysql&#62; INSERT INTO drivers (id, name) VALUES [...]]]></description>
			<content:encoded><![CDATA[<h3></h3>
<p align="center"><img src="http://themysqlguy.com/wp-content/uploads/federated.jpg" /></p>
<p align="center">&nbsp;</p>
<p align="left">&nbsp;</p>
<p class="style">&nbsp;</p>
<p style="padding-top: 0pt" class="paragraph_style">Federated Storage Engine (FSE) allows you to connect to a remote server and &#8220;mount&#8221; a table on your local server, which links to the data on the remote server, for read-only access.</p>
<p class="paragraph_style">&nbsp;</p>
<pre>$ mysql -u root -ppassword -h remote

mysql&gt; CREATE DATABASE test;

mysql&gt; use test;

mysql&gt; CREATE TABLE drivers (id INT,name VARCHAR(100));

mysql&gt; INSERT INTO drivers (id, name) VALUES (1, ‘Chris’);

mysql&gt; INSERT INTO drivers (id, name) VALUES (2, ‘Sheeri’);

mysql&gt; INSERT INTO drivers (id, name) VALUES (3, ‘Elie’);

mysql&gt; select * from drivers;

+------+--------+
| id   | name   |
+------+--------+
|    1 | Chris  |
|    2 | Sheeri |
|    3 | Elie   |
+------+--------+
3 rows in set (0.08 sec)

mysql&gt; exit;</pre>
<pre>

$ mysql -u root -ppassword -h local

mysql&gt; CREATE DATABASE test;

mysql&gt; use test;

mysql&gt; CREATE TABLE drivers (id INT,name VARCHAR(100)) ENGINE=FEDERATED
CONNECTION=’mysql://root:password@remote:3306/test/drivers’;

mysql&gt; select * from drivers;

+------+--------+
| id   | name   |
+------+--------+
|    1 | Chris  |
|    2 | Sheeri |
|    3 | Elie   |
+------+--------+
3 rows in set (0.14 sec)

mysql&gt; exit;</pre>
<p class="paragraph_style_1">&nbsp;</p>
<p class="paragraph_style">Enjoy FSE tables!</p>
<p class="paragraph_style_1">&nbsp;</p>
<p class="paragraph_style">Bye! Thanks for all the fish!</p>
<p style="padding-bottom: 0pt" class="paragraph_style_2"><a href="mailto:christos@themysqlguy.com" title="mailto:christos@themysqlguy.com">christos@themysqlguy.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.themysqlguy.com/?feed=rss2&amp;p=14</wfw:commentRss>
			<enclosure url="http://themysqlguy.com/wp-content/uploads/episodes/episode_05.mp3" length="4691114" type="audio/mpeg"/>
<itunes:duration>9:46</itunes:duration>
		<itunes:subtitle>Episode 5 - Federated Storage Engine</itunes:subtitle>
		<itunes:summary>Episode 5 - Federated Storage Engine</itunes:summary>
		<itunes:keywords>Episodes</itunes:keywords>
		<itunes:author>Christos Kalantzis</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>No</itunes:block>
	</item>
		<item>
		<title>Episode 4 - Some Questions, my Answers 1</title>
		<link>http://www.themysqlguy.com/?p=13</link>
		<comments>http://www.themysqlguy.com/?p=13#comments</comments>
		<pubDate>Sun, 27 May 2007 21:45:07 +0000</pubDate>
		<dc:creator>Christos Kalantzis</dc:creator>
		
		<category><![CDATA[Episodes]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[questions]]></category>

		<guid isPermaLink="false">http://www.themysqlguy.com/?p=13</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<h3></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.themysqlguy.com/?feed=rss2&amp;p=13</wfw:commentRss>
			<enclosure url="http://themysqlguy.com/wp-content/uploads/episodes/episode_04.mp3" length="2578092" type="audio/mpeg"/>
<itunes:duration>5:20</itunes:duration>
		<itunes:subtitle>Episode 4 - Some Questions, my Answers 1</itunes:subtitle>
		<itunes:summary>Welcome to the theMySQLguy.com podcast.  This is where you can get all kinds of useful information about MySQL.  We will cover intermediate to advanced issues.  So the assumption is that you have MySQL installed and running.</itunes:summary>
		<itunes:keywords>Episodes</itunes:keywords>
		<itunes:author>Christos Kalantzis</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>No</itunes:block>
	</item>
		<item>
		<title>Episode 3 - Slow Query Log</title>
		<link>http://www.themysqlguy.com/?p=11</link>
		<comments>http://www.themysqlguy.com/?p=11#comments</comments>
		<pubDate>Fri, 06 Apr 2007 21:25:56 +0000</pubDate>
		<dc:creator>Christos Kalantzis</dc:creator>
		
		<category><![CDATA[Episodes]]></category>

		<category><![CDATA[log]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://www.themysqlguy.com/?p=11</guid>
		<description><![CDATA[

&#160;
&#160;
&#160;
One of the best features of MySQL is the fact that you can
have a log of all queries that take longer than n seconds.
&#160;
Activating the Log
 
&#160;
To activate this log start MySQL with the &#8211;log-slow-queries[=file_name] option, or add the previous option to your my.cnf or my.ini and restart the server:
[mysqld]

&#8230;

log-slow-queries[=file_name]



You can specify a file name [...]]]></description>
			<content:encoded><![CDATA[<h3></h3>
<p align="center"><img src="http://themysqlguy.com/wp-content/uploads/slow.jpg" /></p>
<p align="center">&nbsp;</p>
<p align="left">&nbsp;</p>
<p class="style">&nbsp;</p>
<p style="padding-top: 0pt" class="paragraph_style">One of the best features of MySQL is the fact that you can</p>
<p class="paragraph_style">have a log of all queries that take longer than <span class="style_1">n</span> seconds.</p>
<p class="paragraph_style">&nbsp;</p>
<h2><span style="line-height: 23px" class="style_2">Activating the Log</span></h2>
<h2><span style="line-height: 23px" class="style_2"> </span></h2>
<p class="paragraph_style">&nbsp;</p>
<p class="paragraph_style">To activate this log start MySQL with the <span class="style_1">&#8211;log-slow-queries[=file_name]</span> option, or add the previous option to your my.cnf or my.ini and restart the server:</p>
<pre><span style="line-height: 15px" class="style_3">[mysqld]
</span></pre>
<pre><span style="line-height: 15px" class="style_3">&#8230;
</span></pre>
<pre><span style="line-height: 15px" class="style_3">log-slow-queries[=file_name]
</span></pre>
<p class="paragraph_style_1"><span style="line-height: 15px" class="style_3"><br />
</span></p>
<p class="paragraph_style">You can specify a file name for the slow-query-log or it will be called <span class="style_1">host_name-slow.log</span>.  By default the log is in the data directory, unless you specify an absolute path with the file name.<span style="line-height: 15px" class="style_4"><br />
</span></p>
<p class="paragraph_style"><span style="line-height: 15px" class="style_4"><br />
</span>
</p>
<p class="paragraph_style">By default a slow query is one that takes 10 seconds. You can change that by specifying <span class="style_1">long_query_time</span> in either during startup or in the my.cnf or my.ini file.</p>
<pre><span style="line-height: 15px" class="style_3">[mysqld]
</span></pre>
<pre><span style="line-height: 15px" class="style_3">&#8230;
</span></pre>
<pre><span style="line-height: 15px" class="style_3">log-slow-queries
</span></pre>
<pre><span style="line-height: 15px" class="style_3">long_query_time=8
</span></pre>
<p class="paragraph_style_1"><span style="line-height: 15px" class="style_4"><br />
</span></p>
<p class="paragraph_style"><span style="line-height: 15px" class="style_4"><br />
</span></p>
<h2><span style="line-height: 23px" class="style_2">Viewing the Log</span><span style="line-height: 15px" class="style_4"></span></h2>
<h2><span style="line-height: 15px" class="style_4"> </span></h2>
</p>
<p class="paragraph_style">&nbsp;</p>
<p class="paragraph_style">The log is in text format and can easily be viewed by any text editor and looks like this:</p>
<p class="paragraph_style">&nbsp;</p>
<pre><span style="line-height: 15px" class="style_5"># Time: 070116  5:16:35
</span></pre>
<pre><span style="line-height: 15px" class="style_5"># User@Host: nvusr[nvusr] @ app01 [10.30.5.226]
</span></pre>
<pre><span style="line-height: 15px" class="style_5"># Query_time: 21  Lock_time: 0  Rows_sent: 20  Rows_examined: 4078677
</span></pre>
<pre><span style="line-height: 15px" class="style_5">SELECT ectransactions.*, interchanges.interchange_datetime as transaction_datetime, interchanges.partner_name, interchanges.direction, functional_groups.functional_group_control_numb, fo_name, functional_organization_qualid, partner_name, partner_qualid, interchanges.interchange_control_number, operators.name as operator_name, trading_participants.name as client_name FROM ectransactions  left join functional_groups ON ectransactions.functional_group_id=functional_groups.id left join interchanges ON ectransactions.interchange_id=interchanges.id left join trading_participants ON ectransactions.trading_participant_id=trading_participants.id left join operators ON ectransactions.operator_id=operators.id  ORDER BY client_name asc, transaction_datetime desc  LIMIT 0, 20;</span></pre>
<p class="paragraph_style">&nbsp;</p>
<p class="paragraph_style">However, its a lot more readable with the <span class="style_6">mysqldumpslow</span> command, whose output looks like this:</p>
<p class="paragraph_style">&nbsp;</p>
<pre><span style="line-height: 15px" class="style_5">Count: 1  Time=24.00s (24s)  Lock=0.00s (0s)  Rows=20.0 (20), nvusr[nvusr]@tqapp02
</span></pre>
<pre><span style="line-height: 15px" class="style_5">  SELECT ectransactions.*, interchanges.interchange_datetime as transaction_datetime, interchanges.partner_name, interchanges.direction, functional_groups.functional_group_control_numb, fo_name, functional_organization_qualid, partner_name, partner_qualid, interchanges.interchange_control_number, operators.name as operator_name, trading_participants.name as client_name FROM ectransactions  left join functional_groups ON ectransactions.functional_group_id=functional_groups.id left join interchanges ON ectransactions.interchange_id=interchanges.id left join trading_participants ON ectransactions.trading_participant_id=trading_participants.id left join operators ON ectransactions.operator_id=operators.id  ORDER BY transaction_datetime asc, description desc  LIMIT N, N
</span></pre>
<pre><span style="line-height: 15px" class="style_5">
</span></pre>
<pre><span style="line-height: 15px" class="style_5">Count: 2  Time=22.00s (44s)  Lock=0.00s (0s)  Rows=20.0 (40), nvusr[nvusr]@2hosts
</span></pre>
<pre><span style="line-height: 15px" class="style_5">  SELECT ectransactions.*, interchanges.interchange_datetime as transaction_datetime, interchanges.partner_name, interchanges.direction, functional_groups.functional_group_control_numb, fo_name, functional_organization_qualid, partner_name, partner_qualid, interchanges.interchange_control_number, operators.name as operator_name, trading_participants.name as client_name FROM ectransactions  left join functional_groups ON ectransactions.functional_group_id=functional_groups.id left join interchanges ON ectransactions.interchange_id=interchanges.id left join trading_participants ON ectransactions.trading_participant_id=trading_participants.id left join operators ON ectransactions.operator_id=operators.id  ORDER BY client_name asc, transaction_datetime desc  LIMIT N, N</span></pre>
<p class="paragraph_style">&nbsp;</p>
<p class="paragraph_style">&nbsp;</p>
<h2>I Want More!</h2>
<p class="paragraph_style">You can also have MySQL add all queries that don’t use indexes into the slow-query-log.  Add <strong><span class="style_1">&#8211;log-queries-not-using-indexes</span></strong> during startup or in the <em>my.cnf</em> or <em>my.ini</em> file.</p>
<p class="paragraph_style">&nbsp;</p>
<p class="paragraph_style"><span style="line-height: 15px" class="style_3"></span><br />
Bye! Thanks for all the fish!
</p>
<p style="padding-bottom: 0pt" class="paragraph_style_3"><a href="mailto:christos@themysqlguy.com" title="mailto:christos@themysqlguy.com">christos@themysqlguy.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.themysqlguy.com/?feed=rss2&amp;p=11</wfw:commentRss>
			<enclosure url="http://themysqlguy.com/wp-content/uploads/episodes/episode_03.mp3" length="3404966" type="audio/mpeg"/>
<itunes:duration>7:05</itunes:duration>
		<itunes:subtitle>Episode 3 - Slow Query Log</itunes:subtitle>
		<itunes:summary>Episode 3 - Slow Query Log</itunes:summary>
		<itunes:keywords></itunes:keywords>
		<itunes:author>Christos Kalantzis</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>No</itunes:block>
	</item>
		<item>
		<title>Episode 2 - Starting out &#038; SQL Mode</title>
		<link>http://www.themysqlguy.com/?p=6</link>
		<comments>http://www.themysqlguy.com/?p=6#comments</comments>
		<pubDate>Thu, 08 Mar 2007 00:17:46 +0000</pubDate>
		<dc:creator>Christos Kalantzis</dc:creator>
		
		<category><![CDATA[Episodes]]></category>

		<guid isPermaLink="false">http://www.themysqlguy.com/?p=6</guid>
		<description><![CDATA[

&#160;
&#160;
Starting out
Once MySQL is installed you should assign a root password to the server, drop the guest account and remove certain built-in databases you don’t need.
$ mysql -u root


mysql&#62; DELETE FROM mysql.user WHERE User = &#8221;;


mysql&#62; UPDATE mysql.user SET Password = PASSWORD(&#8217;some_pass&#8217;) WHERE User = &#8216;root&#8217;;


mysql&#62; DELETE FROM mysql.user WHERE Host &#60;&#62; &#8216;localhost&#8217;;


mysql&#62; UPDATE mysql.user [...]]]></description>
			<content:encoded><![CDATA[<h3></h3>
<p align="center"><img src="http://www.themysqlguy.com/wp-content/uploads/2007/09/shapeimage_21.jpg" /></p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<h2>Starting out</h2>
<p class="paragraph_style">Once MySQL is installed you should assign a <span class="style_1">root</span> password to the server, drop the guest account and remove certain built-in databases you don’t need.</p>
<pre><span style="line-height: 15px" class="style_2">$</span><span style="line-height: 15px" class="style_3"> mysql -u root

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> DELETE FROM mysql.user WHERE User = &#8221;;

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> UPDATE mysql.user SET Password = PASSWORD(&#8217;some_pass&#8217;) WHERE User = &#8216;root&#8217;;

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> DELETE FROM mysql.user WHERE Host &lt;&gt; &#8216;localhost&#8217;;

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> UPDATE mysql.user SET Host = &#8216;%&#8217;;

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> create database modes;

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> drop database test;

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> FLUSH PRIVILEGES;

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> quit;

</span></pre>
<pre><span style="line-height: 15px" class="style_3">

</span></pre>
<pre><span style="line-height: 15px" class="style_2">$</span><span style="line-height: 15px" class="style_3"> mysql -u root -psome_pass

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;

</span></pre>
<pre><span style="line-height: 15px" class="style_3">

</span></pre>
<pre><span style="line-height: 15px" class="style_2">$</span><span style="line-height: 15px" class="style_3"> mysql -u root -p

</span></pre>
<pre><span style="line-height: 15px" class="style_3">Enter password:

</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;

</span></pre>
<p class="paragraph_style"><span style="line-height: 15px" class="style_2"><br />
</span></p>
<h2>SQL Mode</h2>
</p>
<p class="paragraph_style">The SQL Mode you chose is very important because it affects how your MySQL server will behave in certain situations.</p>
<p class="paragraph_style">&nbsp;</p>
<p class="paragraph_style">By Default it runs in “no mode”.  Which is kind of a free-for-all mode.  This mode is very forgiving&#8230;maybe too forgiving for some “Enterprise” applications.</p>
<p class="paragraph_style">&nbsp;</p>
<pre><span style="line-height: 15px" class="style_2">$</span><span style="line-height: 15px" class="style_2"> mysql -u root -psome_pass </span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> use modes; </span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> CREATE TABLE drivers (id TINYINT UNSIGNED, name CHAR(5));

Query OK, 0 rows affected (0.03 sec)</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> INSERT INTO drivers (id, name) VALUES (255,&#8217;Doug&#8217;);

Query OK, 1 row affected (0.02 sec) </span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> select * from drivers;

+&#8212;&#8212;+&#8212;&#8212;+

| id   | name |

+&#8212;&#8212;+&#8212;&#8212;+

|  255 | Doug |

+&#8212;&#8212;+&#8212;&#8212;+

1 row in set (0.00 sec) </span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> INSERT INTO drivers (id, name) VALUES (259,&#8217;Christos&#8217;);

Query OK, 1 row affected, 2 warnings (0.00 sec) </span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> select * from drivers;

+&#8212;&#8212;+&#8212;&#8212;-+

| id   | name  |

+&#8212;&#8212;+&#8212;&#8212;-+

|  255 | Doug  |

|  255 | Chris |

+&#8212;&#8212;+&#8212;&#8212;-+

2 rows in set (0.00 sec) </span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> DROP TABLE drivers;

Query OK, 0 rows affected (0.07 sec) </span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> quit; </span><span style="line-height: 15px" class="style_3"></span></pre>
<p>To avoid the above scenario, you must assign an SQL Mode to your MySQL server.  I like the <span class="style_1">traditional</span> mode.  It would raise an error if you tried to run the above commands.</p>
<p class="paragraph_style">&nbsp;</p>
<p class="paragraph_style">Add <span class="style_4">sql_mode=traditional</span> in your my.cnf/my.ini file, restart the server and that will solve the issue.  It would give the following results:</p>
<p class="paragraph_style">&nbsp;</p>
<pre><span style="line-height: 15px" class="style_2">$</span><span style="line-height: 15px" class="style_2"> mysql -u root -psome_pass</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> use modes;</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> CREATE TABLE drivers (id TINYINT UNSIGNED, name CHAR(5));

Query OK, 0 rows affected (0.03 sec)</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> INSERT INTO drivers (id, name) VALUES (255,&#8217;Doug&#8217;);

Query OK, 1 row affected (0.02 sec)</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> select * from drivers;

+&#8212;&#8212;+&#8212;&#8212;+

| id   | name |

+&#8212;&#8212;+&#8212;&#8212;+

|  255 | Doug |

+&#8212;&#8212;+&#8212;&#8212;+

1 row in set (0.00 sec)</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> INSERT INTO drivers (id, name) VALUES (259,&#8217;Christos&#8217;);

ERROR 1264 (22003): Out of range value adjusted for column &#8216;id&#8217; at row 1</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_2"> DROP TABLE drivers;

Query OK, 0 rows affected (0.07 sec)</span></pre>
<pre><span style="line-height: 15px" class="style_2">mysql&gt;</span><span style="line-height: 15px" class="style_3"> quit; </span><span style="line-height: 15px" class="style_3"></span></pre>
<p class="paragraph_style">There are more SQL Modes to choose from.  Click <a href="http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html" title="http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html">here</a> to get a complete list of modes and a more in-depth explanation of each one.</p>
<p class="paragraph_style">&nbsp;</p>
<p class="paragraph_style">Bye! Thanks for all the fish!</p>
<address><a href="mailto:christos@themysqlguy.com" title="mailto:christos@themysqlguy.com">christos@themysqlguy.com</a></address>
]]></content:encoded>
			<wfw:commentRss>http://www.themysqlguy.com/?feed=rss2&amp;p=6</wfw:commentRss>
			<enclosure url="http://themysqlguy.com/wp-content/uploads/episodes/episode_02.mp3" length="7617859" type="audio/mpeg"/>
<itunes:duration>15:49</itunes:duration>
		<itunes:subtitle>Episode 2 - Starting out  SQL Mode</itunes:subtitle>
		<itunes:summary>Episode 2 - Starting out  SQL Mode</itunes:summary>
		<itunes:keywords></itunes:keywords>
		<itunes:author>Christos Kalantzis</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>No</itunes:block>
	</item>
	</channel>
</rss>
