<?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"
	>
<channel>
	<title>Comments on: Converting MySQL Database Contents to UTF-8</title>
	<atom:link href="http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/feed/" rel="self" type="application/rss+xml" />
	<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/</link>
	<description>More than just a blog.</description>
	<pubDate>Mon, 07 Jul 2008 02:20:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Vladimir Kolesnikov</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-391471</link>
		<dc:creator>Vladimir Kolesnikov</dc:creator>
		<pubDate>Sat, 22 Mar 2008 18:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-391471</guid>
		<description>&lt;blockquote&gt;
  &lt;p&gt;Where to write this?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Frank, you will need to log into the server with your SSH client (provided you have SSH access enabled). And in the command line you type those commands.&lt;/p&gt;

&lt;p&gt;Alternatively, you can probably do this with the help of PHP Shell.&lt;/p&gt;

&lt;p&gt;Please feel free to contact me if you need help: sjinks (at) sjinks (dot) org (dot) ua&lt;/p&gt;

&lt;p&gt;Regards,
Vladimir&lt;/p&gt;</description>
		<content:encoded><![CDATA[<blockquote>
<p>Where to write this?</p>
</blockquote>
<p>Frank, you will need to log into the server with your SSH client (provided you have SSH access enabled). And in the command line you type those commands.</p>
<p>Alternatively, you can probably do this with the help of PHP Shell.</p>
<p>Please feel free to contact me if you need help: sjinks (at) sjinks (dot) org (dot) ua</p>
<p>Regards,<br />
Vladimir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-390936</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Thu, 20 Mar 2008 02:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-390936</guid>
		<description>&lt;p&gt;Damn... I don't get anything.
Seems, it DOES work.&lt;/p&gt;

&lt;p&gt;Where to write this?  mysqldump --opt -u root -p wordpress &#62; wordpress.sql&lt;/p&gt;

&lt;p&gt;No idea where to start. Please help me guys to fix this old Mongolian DB!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Damn&#8230; I don&#8217;t get anything.<br />
Seems, it DOES work.</p>
<p>Where to write this?  mysqldump &#8211;opt -u root -p wordpress &gt; wordpress.sql</p>
<p>No idea where to start. Please help me guys to fix this old Mongolian DB!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladimir Kolesnikov</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-389984</link>
		<dc:creator>Vladimir Kolesnikov</dc:creator>
		<pubDate>Thu, 13 Mar 2008 14:50:54 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-389984</guid>
		<description>&lt;p&gt;Sorry, I have mistaken with the statement: it should be&lt;/p&gt;

&lt;p&gt;ALTER TABLE &lt;code&gt;table_name&lt;/code&gt; CONVERT TO CHARACTER SET 'utf8';&lt;/p&gt;

&lt;p&gt;I have recently faced the same problem and that statement did really help!&lt;/p&gt;

&lt;p&gt;You can read about it here: &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/alter-table.html" rel="nofollow"&gt;http://dev.mysql.com/doc/refman/5.0/en/alter-table.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Believe me, it works :-)&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Sorry, I have mistaken with the statement: it should be</p>
<p>ALTER TABLE <code>table_name</code> CONVERT TO CHARACTER SET &#8216;utf8&#8242;;</p>
<p>I have recently faced the same problem and that statement did really help!</p>
<p>You can read about it here: <a href="http://dev.mysql.com/doc/refman/5.0/en/alter-table.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/alter-table.html</a></p>
<p>Believe me, it works <img src='http://climbtothestars.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephanie</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-389613</link>
		<dc:creator>Stephanie</dc:creator>
		<pubDate>Mon, 10 Mar 2008 11:41:44 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-389613</guid>
		<description>&lt;p&gt;I'm afraid that does not convert the actual content. It won't work in this case. Trust me, I'd have done it, otherwise ;-)&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m afraid that does not convert the actual content. It won&#8217;t work in this case. Trust me, I&#8217;d have done it, otherwise <img src='http://climbtothestars.org/wp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vladimir Kolesnikov</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-389558</link>
		<dc:creator>Vladimir Kolesnikov</dc:creator>
		<pubDate>Sun, 09 Mar 2008 20:48:10 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-389558</guid>
		<description>&lt;p&gt;AFAIK, this could be done much simpler:&lt;/p&gt;

&lt;p&gt;ALTER TABLE &lt;code&gt;table_name&lt;/code&gt; CHARSET 'utf8';&lt;/p&gt;

&lt;p&gt;This is what official MySQL documentation says: "If you want to change all CHAR/VARCHAR/TEXT columns to a new character set  you can do: ALTER TABLE table_name CHARACTER SET character_set_name;"&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>AFAIK, this could be done much simpler:</p>
<p>ALTER TABLE <code>table_name</code> CHARSET &#8216;utf8&#8242;;</p>
<p>This is what official MySQL documentation says: &#8220;If you want to change all CHAR/VARCHAR/TEXT columns to a new character set  you can do: ALTER TABLE table_name CHARACTER SET character_set_name;&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-381421</link>
		<dc:creator>Christophe</dc:creator>
		<pubDate>Fri, 25 Jan 2008 07:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-381421</guid>
		<description>&lt;p&gt;I found another link that talks about your method and ads a little more details.  People might find this helpful too:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://gentoo-wiki.com/TIP_Convert_latin1_to_UTF-8_in_MySQL" rel="nofollow"&gt;http://gentoo-wiki.com/TIP_Convert_latin1_to_UTF-8_in_MySQL&lt;/a&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I found another link that talks about your method and ads a little more details.  People might find this helpful too:</p>
<p><a href="http://gentoo-wiki.com/TIP_Convert_latin1_to_UTF-8_in_MySQL" rel="nofollow">http://gentoo-wiki.com/TIP_Convert_latin1_to_UTF-8_in_MySQL</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-381416</link>
		<dc:creator>Christophe</dc:creator>
		<pubDate>Fri, 25 Jan 2008 07:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-381416</guid>
		<description>&lt;p&gt;Here is a technique I found that allows you to do the conversion to unicode through phpMyAdmin.  I have tried this personally with a WP site/database and it worked for me on a site that has both English and Japanese text.  This approach becomes really tedious if you have a lot of database tables though.&lt;/p&gt;

&lt;p&gt;Making your Wordpress database portable:
&lt;a href="http://jonkenpon.com/2007/02/20/making-your-wordpress-database-portable-because-it-probably-isnt-right-now/" rel="nofollow"&gt;http://jonkenpon.com/2007/02/20/making-your-wordpress-database-portable-because-it-probably-isnt-right-now/&lt;/a&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Here is a technique I found that allows you to do the conversion to unicode through phpMyAdmin.  I have tried this personally with a WP site/database and it worked for me on a site that has both English and Japanese text.  This approach becomes really tedious if you have a lot of database tables though.</p>
<p>Making your Wordpress database portable:<br />
<a href="http://jonkenpon.com/2007/02/20/making-your-wordpress-database-portable-because-it-probably-isnt-right-now/" rel="nofollow">http://jonkenpon.com/2007/02/20/making-your-wordpress-database-portable-because-it-probably-isnt-right-now/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Climb to the Stars (Stephanie Booth) &#187; Going Solo Venues, Open Stage, and Link Love</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-380661</link>
		<dc:creator>Climb to the Stars (Stephanie Booth) &#187; Going Solo Venues, Open Stage, and Link Love</dc:creator>
		<pubDate>Tue, 22 Jan 2008 12:50:11 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-380661</guid>
		<description>&lt;p&gt;[...] the fact that some of my blog posts have already been around the world three times (my stuff on MySQL encoding problems and multiple WordPress installations have remained popular for years &#8212; the latter with [...]&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>[...] the fact that some of my blog posts have already been around the world three times (my stuff on MySQL encoding problems and multiple WordPress installations have remained popular for years &#8212; the latter with [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strawks</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-227117</link>
		<dc:creator>strawks</dc:creator>
		<pubDate>Fri, 13 Jul 2007 13:08:42 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-227117</guid>
		<description>&lt;p&gt;I had to convert a database from iso latin1 to UTF-8, but I'm not an expert in encodings.
What I found out is that MySQL obviously uses the character set you specify when creating a table to store the data and makes conversions depending of the client.
If the DB is stored using UTF-8 and the client specify latin1 (using the SET NAMES 'latin1' statement) after connecting, MySQL will convert all data to latin1 before sending the results to the client.&lt;/p&gt;

&lt;p&gt;My need was to convert a database stored in latin1 to UTF-8, so I simply used the following commands (a quick hack) and MySQL would do the rest :&lt;/p&gt;

&lt;p&gt;mysqldump --opt -u db_user -p db_name &#124; sed "s/CHARSET=latin1/CHARSET=utf8/" &#62; db.dump.sql&lt;/p&gt;

&lt;p&gt;mysql -u db_user -p -D db_name &#60; db.dump.sql&lt;/p&gt;

&lt;p&gt;As suggested by Egil, specifying the charset to these commands would be wise.&lt;/p&gt;

&lt;p&gt;The default charset of my server is latin1 so db.dump.sql is encoded in latin1, sed replaces all default charset for each table from latin1 to UTF-8 and the second mysql will parse the file using the latin1 charset, send the query to the server in latin1 and the server will convert and store all the data in UTF-8.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I had to convert a database from iso latin1 to UTF-8, but I&#8217;m not an expert in encodings.<br />
What I found out is that MySQL obviously uses the character set you specify when creating a table to store the data and makes conversions depending of the client.<br />
If the DB is stored using UTF-8 and the client specify latin1 (using the SET NAMES &#8216;latin1&#8242; statement) after connecting, MySQL will convert all data to latin1 before sending the results to the client.</p>
<p>My need was to convert a database stored in latin1 to UTF-8, so I simply used the following commands (a quick hack) and MySQL would do the rest :</p>
<p>mysqldump &#8211;opt -u db_user -p db_name | sed &#8220;s/CHARSET=latin1/CHARSET=utf8/&#8221; &gt; db.dump.sql</p>
<p>mysql -u db_user -p -D db_name &lt; db.dump.sql</p>
<p>As suggested by Egil, specifying the charset to these commands would be wise.</p>
<p>The default charset of my server is latin1 so db.dump.sql is encoded in latin1, sed replaces all default charset for each table from latin1 to UTF-8 and the second mysql will parse the file using the latin1 charset, send the query to the server in latin1 and the server will convert and store all the data in UTF-8.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gomba</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-190469</link>
		<dc:creator>gomba</dc:creator>
		<pubDate>Thu, 31 May 2007 13:23:35 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-190469</guid>
		<description>&lt;p&gt;I had problem converting a joomla ISO DB to UTF8 using the iconv -f iso-8859-15 -t utf8... 
It didn't convert german special caracters.&lt;/p&gt;

&lt;p&gt;Then I used iconv -f CP1252 -t utf8 and it worked perfecly....&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I had problem converting a joomla ISO DB to UTF8 using the iconv -f iso-8859-15 -t utf8&#8230;<br />
It didn&#8217;t convert german special caracters.</p>
<p>Then I used iconv -f CP1252 -t utf8 and it worked perfecly&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marek</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-185031</link>
		<dc:creator>Marek</dc:creator>
		<pubDate>Sun, 20 May 2007 19:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-185031</guid>
		<description>&lt;p&gt;Thank you for this post, especially the iconv bit! It worked perfectly!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Thank you for this post, especially the iconv bit! It worked perfectly!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wal-d</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-164356</link>
		<dc:creator>wal-d</dc:creator>
		<pubDate>Sat, 14 Apr 2007 10:06:36 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-164356</guid>
		<description>&lt;p&gt;thanks you soo much for you documentation on how to convert the charset, it saved me a lot of time .. grüsse&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>thanks you soo much for you documentation on how to convert the charset, it saved me a lot of time .. grüsse</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-143129</link>
		<dc:creator>John</dc:creator>
		<pubDate>Thu, 01 Mar 2007 22:02:55 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-143129</guid>
		<description>&lt;p&gt;This info just saved my life.  I thank you.  &lt;em&gt;bows&lt;/em&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>This info just saved my life.  I thank you.  <em>bows</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Climb to the Stars (Stephanie Booth)</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-138418</link>
		<dc:creator>Climb to the Stars (Stephanie Booth)</dc:creator>
		<pubDate>Sat, 03 Feb 2007 22:53:03 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-138418</guid>
		<description>&lt;p&gt;&lt;strong&gt;Invalid argument supplied for foreach() in wp-capabilities.php: Case Cracked!...&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finally. At last. Endlich. Enfin.&lt;/p&gt;

&lt;p&gt;Once more, while trying to transfer a WordPress installation from one server to another, I found myself facing the dreaded problem which locks me out of my WordPress install with a rather cryptic message:&lt;/p&gt;

&lt;p&gt;Warning: In...&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p><strong>Invalid argument supplied for foreach() in wp-capabilities.php: Case Cracked!&#8230;</strong></p>
<p>Finally. At last. Endlich. Enfin.</p>
<p>Once more, while trying to transfer a WordPress installation from one server to another, I found myself facing the dreaded problem which locks me out of my WordPress install with a rather cryptic message:</p>
<p>Warning: In&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eWebmaster</title>
		<link>http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-137586</link>
		<dc:creator>eWebmaster</dc:creator>
		<pubDate>Wed, 31 Jan 2007 18:22:34 +0000</pubDate>
		<guid isPermaLink="false">http://climbtothestars.org/archives/2004/07/18/converting-mysql-database-contents-to-utf-8/#comment-137586</guid>
		<description>&lt;p&gt;OR you can&lt;/p&gt;

&lt;p&gt;Executing SQL Statements from a Text File&lt;/p&gt;

&lt;p&gt;The mysql client typically is used interactively, like this:&lt;/p&gt;

&lt;p&gt;shell&#62; mysql db_name&lt;/p&gt;

&lt;p&gt;However, it is also possible to put your SQL statements in a file and then tell mysql to read its input from that file. To do so, create a text file text_file that contains the statements you wish to execute. Then invoke mysql as shown here:&lt;/p&gt;

&lt;p&gt;shell&#62; mysql db_name &#60; text_file&lt;/p&gt;

&lt;p&gt;If you place a USE db_name statement as the first statement in the file, it is unnecessary to specify the database name on the command line:&lt;/p&gt;

&lt;p&gt;shell&#62; mysql &#60; text_file&lt;/p&gt;

&lt;p&gt;If you are already running mysql, you can execute an SQL script file using the source or . command:&lt;/p&gt;

&lt;p&gt;mysql&#62; source file_name
mysql&#62; . file_name&lt;/p&gt;

&lt;p&gt;Sometimes you may want your script to display progress information to the user. For this you can insert statements like this:&lt;/p&gt;

&lt;p&gt;SELECT '' AS ' ';&lt;/p&gt;

&lt;p&gt;The statement shown outputs .&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>OR you can</p>
<p>Executing SQL Statements from a Text File</p>
<p>The mysql client typically is used interactively, like this:</p>
<p>shell&gt; mysql db_name</p>
<p>However, it is also possible to put your SQL statements in a file and then tell mysql to read its input from that file. To do so, create a text file text_file that contains the statements you wish to execute. Then invoke mysql as shown here:</p>
<p>shell&gt; mysql db_name &lt; text_file</p>
<p>If you place a USE db_name statement as the first statement in the file, it is unnecessary to specify the database name on the command line:</p>
<p>shell&gt; mysql &lt; text_file</p>
<p>If you are already running mysql, you can execute an SQL script file using the source or . command:</p>
<p>mysql&gt; source file_name<br />
mysql&gt; . file_name</p>
<p>Sometimes you may want your script to display progress information to the user. For this you can insert statements like this:</p>
<p>SELECT &#8221; AS &#8216; &#8216;;</p>
<p>The statement shown outputs .</p>
]]></content:encoded>
	</item>
</channel>
</rss>
