<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Convert MyISAM tables to InnoDB</title>
	<atom:link href="http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:43:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Richard Dutton</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-24872</link>
		<dc:creator>Richard Dutton</dc:creator>
		<pubDate>Sun, 25 Sep 2011 04:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-24872</guid>
		<description>if you really want to get nuts you can use my favorite... just change the &quot;webdb&quot; string for your particular database or remove that whole line for them all... i use this to give me a list of the tables that have a primary key and do not have any full text fields (yes some people out there still dont put a PK in :( )

select 
	TABLES.TABLE_SCHEMA as `Database`,
	TABLES.table_name as `Table`,
	columns.column_name as `Primary Key`,
	CONCAT(&#039;ALTER TABLE `&#039;,TABLES.TABLE_SCHEMA,&#039;`.`&#039;,TABLES.table_name,&#039;` ORDER BY `&#039;,columns.column_name,&#039;`; ALTER TABLE `&#039;,TABLES.TABLE_SCHEMA,&#039;`.`&#039;,TABLES.table_name,&#039;` engine=InnoDB;&#039;) as `Command`
from 
	information_schema.TABLES 
	left join information_schema.columns
		on columns.table_name = TABLES.table_name
where 
	TABLES.ENGINE = &quot;MyISAM&quot; 
	and TABLES.TABLE_SCHEMA != &quot;information_schema&quot;
	and TABLES.TABLE_SCHEMA != &quot;mysql&quot;
	and columns.column_key = &quot;PRI&quot;
	and TABLES.table_name = &quot;webdb&quot;
	and concat(TABLES.TABLE_SCHEMA,&quot;.&quot;,TABLES.TABLE_NAME) not in 
	(
		SELECT 
			concat(STATISTICS.TABLE_SCHEMA,&quot;.&quot;,STATISTICS.TABLE_NAME) as `Fulltable Name`
		FROM     
			information_schema.STATISTICS
		WHERE 
			STATISTICS.index_type = &quot;FULLTEXT&quot; 
		ORDER BY 
			1
	)
order by
	TABLES.TABLE_SCHEMA,
	TABLES.table_name;</description>
		<content:encoded><![CDATA[<p>if you really want to get nuts you can use my favorite... just change the "webdb" string for your particular database or remove that whole line for them all... i use this to give me a list of the tables that have a primary key and do not have any full text fields (yes some people out there still dont put a PK in <img src='http://rackerhacker.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  )</p>
<p>select<br />
	TABLES.TABLE_SCHEMA as `Database`,<br />
	TABLES.table_name as `Table`,<br />
	columns.column_name as `Primary Key`,<br />
	CONCAT('ALTER TABLE `',TABLES.TABLE_SCHEMA,'`.`',TABLES.table_name,'` ORDER BY `',columns.column_name,'`; ALTER TABLE `',TABLES.TABLE_SCHEMA,'`.`',TABLES.table_name,'` engine=InnoDB;') as `Command`<br />
from<br />
	information_schema.TABLES<br />
	left join information_schema.columns<br />
		on columns.table_name = TABLES.table_name<br />
where<br />
	TABLES.ENGINE = "MyISAM"<br />
	and TABLES.TABLE_SCHEMA != "information_schema"<br />
	and TABLES.TABLE_SCHEMA != "mysql"<br />
	and columns.column_key = "PRI"<br />
	and TABLES.table_name = "webdb"<br />
	and concat(TABLES.TABLE_SCHEMA,".",TABLES.TABLE_NAME) not in<br />
	(<br />
		SELECT<br />
			concat(STATISTICS.TABLE_SCHEMA,".",STATISTICS.TABLE_NAME) as `Fulltable Name`<br />
		FROM<br />
			information_schema.STATISTICS<br />
		WHERE<br />
			STATISTICS.index_type = "FULLTEXT"<br />
		ORDER BY<br />
			1<br />
	)<br />
order by<br />
	TABLES.TABLE_SCHEMA,<br />
	TABLES.table_name;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mjc</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-23495</link>
		<dc:creator>mjc</dc:creator>
		<pubDate>Mon, 18 Jul 2011 20:21:32 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-23495</guid>
		<description>wojtha&#039;s query needs `` around table and db names in the output:

&lt;code&gt;
SELECT CONCAT(&#039;ALTER TABLE `&#039;,table_schema,&#039;`.`&#039;,table_name,&#039;` ORDER BY primary_key_column; ALTER TABLE `&#039;,table_schema,&#039;`.`&#039;,table_name,&#039;` engine=InnoDB;&#039;) FROM information_schema.tables WHERE TABLE_SCHEMA=&#039;xbmc-tv&#039; AND ENGINE = &#039;MyISAM&#039;;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>wojtha's query needs `` around table and db names in the output:</p>
<p><code><br />
SELECT CONCAT('ALTER TABLE `',table_schema,'`.`',table_name,'` ORDER BY primary_key_column; ALTER TABLE `',table_schema,'`.`',table_name,'` engine=InnoDB;') FROM information_schema.tables WHERE TABLE_SCHEMA='xbmc-tv' AND ENGINE = 'MyISAM';<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wojtha</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-23295</link>
		<dc:creator>wojtha</dc:creator>
		<pubDate>Thu, 23 Jun 2011 12:34:42 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-23295</guid>
		<description>Use this to batch generate the queries:

SELECT CONCAT(&#039;ALTER TABLE &#039;,table_schema,&#039;.&#039;,table_name,&#039; ORDER BY primary_key_column; ALTER TABLE &#039;,table_schema,&#039;.&#039;,table_name,&#039; engine=InnoDB;&#039;) FROM information_schema.tables WHERE TABLE_SCHEMA=&#039;my_database&#039; AND ENGINE = &#039;MyISAM&#039;;

Replace &#039;my_database&#039; with your DB name.

Originated from:
http://codesnippets.joyent.com/posts/show/1451</description>
		<content:encoded><![CDATA[<p>Use this to batch generate the queries:</p>
<p>SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' ORDER BY primary_key_column; ALTER TABLE ',table_schema,'.',table_name,' engine=InnoDB;') FROM information_schema.tables WHERE TABLE_SCHEMA='my_database' AND ENGINE = 'MyISAM';</p>
<p>Replace 'my_database' with your DB name.</p>
<p>Originated from:<br />
<a href="http://codesnippets.joyent.com/posts/show/1451" rel="nofollow">http://codesnippets.joyent.com/posts/show/1451</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nova blog &#187; MyIsam to INNODB</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-15740</link>
		<dc:creator>nova blog &#187; MyIsam to INNODB</dc:creator>
		<pubDate>Wed, 13 Jan 2010 11:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-15740</guid>
		<description>[...] http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/" rel="nofollow">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CodeRogue</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-15555</link>
		<dc:creator>CodeRogue</dc:creator>
		<pubDate>Thu, 22 Oct 2009 16:04:13 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-15555</guid>
		<description>How can I list what all the civicrm tablenames are in a database and have that list display the engine type as well?

Somehow, I have some of the tables with Engine Type INNODB, and other MyISAM.  : (

When I try to manually change one of them, I get Error (121) with some text prior to it.

Thanks for the assist</description>
		<content:encoded><![CDATA[<p>How can I list what all the civicrm tablenames are in a database and have that list display the engine type as well?</p>
<p>Somehow, I have some of the tables with Engine Type INNODB, and other MyISAM.  : (</p>
<p>When I try to manually change one of them, I get Error (121) with some text prior to it.</p>
<p>Thanks for the assist</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geoff</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-15405</link>
		<dc:creator>geoff</dc:creator>
		<pubDate>Mon, 27 Jul 2009 04:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-15405</guid>
		<description>Actually, those are NOT quotes, they are backticks, you know, the key next to the &quot;1&quot; on the common qwerty keyboard, and they are in fact correct.</description>
		<content:encoded><![CDATA[<p>Actually, those are NOT quotes, they are backticks, you know, the key next to the "1" on the common qwerty keyboard, and they are in fact correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: papsy</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-5945</link>
		<dc:creator>papsy</dc:creator>
		<pubDate>Mon, 15 Dec 2008 23:28:55 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-5945</guid>
		<description>In some cases, this statement does not work:

ALTER TABLE tablename ORDER BY &#039;primary_key_column&#039;;

Instead, use:

ALTER TABLE tablename ORDER BY primary_key_column;

(Note the removal of the single quotes)</description>
		<content:encoded><![CDATA[<p>In some cases, this statement does not work:</p>
<p>ALTER TABLE tablename ORDER BY 'primary_key_column';</p>
<p>Instead, use:</p>
<p>ALTER TABLE tablename ORDER BY primary_key_column;</p>
<p>(Note the removal of the single quotes)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thornibr</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-117</link>
		<dc:creator>thornibr</dc:creator>
		<pubDate>Mon, 19 Nov 2007 15:22:20 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-117</guid>
		<description>MySIAM data files are stored arbitrary - its only the ibdata files that are stored sorted to the primary key. So this is pointless to do when converting from innodb to MyIASM.</description>
		<content:encoded><![CDATA[<p>MySIAM data files are stored arbitrary - its only the ibdata files that are stored sorted to the primary key. So this is pointless to do when converting from innodb to MyIASM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lokimona</title>
		<link>http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-79</link>
		<dc:creator>lokimona</dc:creator>
		<pubDate>Thu, 25 Oct 2007 02:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://rackerhacker.com/2007/10/03/convert-myisam-tables-to-innodb/#comment-79</guid>
		<description>will the same trick for me  to convert  innodb to Myisam just by changing the ENGINE = INNODB to ENGINE = MYISAM .Do i have to make changes</description>
		<content:encoded><![CDATA[<p>will the same trick for me  to convert  innodb to Myisam just by changing the ENGINE = INNODB to ENGINE = MYISAM .Do i have to make changes</p>
]]></content:encoded>
	</item>
</channel>
</rss>

