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

<channel>
	<title>Word Virus &#187; mySQL</title>
	<atom:link href="http://wordvirus.us/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://wordvirus.us</link>
	<description>The word is now a virus. - William S. Burroughs</description>
	<lastBuildDate>Mon, 06 Feb 2012 11:00:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Copying a database between MySQL servers</title>
		<link>http://wordvirus.us/2011/05/copying-a-database-between-mysql-servers/</link>
		<comments>http://wordvirus.us/2011/05/copying-a-database-between-mysql-servers/#comments</comments>
		<pubDate>Wed, 25 May 2011 17:40:10 +0000</pubDate>
		<dc:creator>gabriel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[mySQL]]></category>

		<guid isPermaLink="false">http://wordvirus.us/?p=5686</guid>
		<description><![CDATA[I was trying to migrate a MySQL database today, that contained Chinese characters. When you dump the database to standard out, like you normally would with mysqldump, the export doesn&#8217;t keep the Chinese characters. I did all sorts of things with the character set, etc., and nothing seemed to work. I always ended up with [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to migrate a MySQL database today, that contained Chinese characters.  When you dump the database to standard out, like you normally would with mysqldump, the export doesn&#8217;t keep the Chinese characters.  I did all sorts of things with the character set, etc., and nothing seemed to work.  I always ended up with garbage on import.  Obviously, the database is UTF-8, but the text file doesn&#8217;t work the way I expected.  I tried the mysqldump command, passing the -r command, specifying the location to output the file.  This is supposed to solve this problem, because it&#8217;s not going through standard out.  However, you are left using standard in for the import, or you can cut in paste into MySQL Workbench.  In any case, none of these worked.  The characters were always corrupted.  After doing a bit of research, and thinking about it for a few, I realized I could pipe the process directly from one MySQL box to another.  This shouldn&#8217;t have seemed like rocket science, but I&#8217;d never thought of doing an export/import like this before.  Here&#8217;s the syntax.</p>
<p>First, create the database on the remote machine, either by logging in our through mysqladmin.</p>
<p>mysqladmin -h host_name -u user_name -p create db_name</p>
<p>Next, pipe the dump from the original server to the new server.</p>
<p>mysqldump db_name | mysql -h host_name -u user_name -p db_name</p>
<p>This seems like a really easy solution for migration, though I found virtually no documentation on doing such a migration in this manner.  </p>
]]></content:encoded>
			<wfw:commentRss>http://wordvirus.us/2011/05/copying-a-database-between-mysql-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better last key inserted function for mySQL in ColdFusion8</title>
		<link>http://wordvirus.us/2008/06/i-guess-i-should-read-the-documentation-for-coldfusion-8-more-often-%c2%a0turns-out-there-is-a-new-feature-when-doing-database-inserts-%c2%a0in-the-cfquery-tag-add-the-parameter-result8221/</link>
		<comments>http://wordvirus.us/2008/06/i-guess-i-should-read-the-documentation-for-coldfusion-8-more-often-%c2%a0turns-out-there-is-a-new-feature-when-doing-database-inserts-%c2%a0in-the-cfquery-tag-add-the-parameter-result8221/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 01:29:00 +0000</pubDate>
		<dc:creator>gabriel</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[mySQL]]></category>

		<guid isPermaLink="false">http://tumblr.themadness.org/post/40012728</guid>
		<description><![CDATA[I guess I should read the documentation for ColdFusion 8 more often.  Turns out, there is a new feature when doing database inserts.  In the CFQUERY tag, add the parameter result=&#8221;somename&#8221;.  You can now reference the data inserted into the query, as well as, a really cool new feature, the last inserted key.  Each database [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://14.media.tumblr.com/8u59InXbmapw9225ZNW3wazh_500.png" alt=""/><br/><br/>
<p>I guess I should read the documentation for ColdFusion 8 more often.  Turns out, there is a new feature when doing database inserts.  In the CFQUERY tag, add the parameter result=&#8221;somename&#8221;.  You can now reference the data inserted into the query, as well as, a really cool new feature, the last inserted key.  Each database type has a different name for this.  MySQL calls it GENERATED_KEY.  You no longer need to do a second query to get back the last_insert_id().</p>
<p><code> </code></p>
<p>&lt;cfquery datasource=&#8221;#application.dsn#&#8221; result=&#8221;insertPhoto&#8221;&gt;</p>
<p>INSERT INTO kidPhotos</p>
<p>(subject, body, dateOf, siteType)</p>
<p>VALUES</p>
<p>(&lt;cfqueryparam value=&#8221;#subject#&#8221; cfsqltype=&#8221;cf_sql_varchar&#8221;&gt;,</p>
<p>&lt;cfqueryparam value=&#8221;#body#&#8221; cfsqltype=&#8221;cf_sql_varchar&#8221;&gt;,</p>
<p>&#8216;#dateformat(date, &#8220;yyyy-mm-dd&#8221;)#&#8217;,</p>
<p>&#8216;ap&#8217;)</p>
<p>&lt;/cfquery&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://wordvirus.us/2008/06/i-guess-i-should-read-the-documentation-for-coldfusion-8-more-often-%c2%a0turns-out-there-is-a-new-feature-when-doing-database-inserts-%c2%a0in-the-cfquery-tag-add-the-parameter-result8221/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.514 seconds -->

