<?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>Tech Notes &#187; mysql</title>
	<atom:link href="http://www.ryannitz.org/tech-notes/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryannitz.org/tech-notes</link>
	<description>Miscellaneous technology examples and notes</description>
	<lastBuildDate>Mon, 10 Aug 2009 18:29:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
  <link>http://www.ryannitz.org/tech-notes</link>
  <url>http://ryan-nitz/favicon.ico</url>
  <title>Tech Notes</title>
</image>
		<item>
		<title>MySQL and Negative Infinity</title>
		<link>http://www.ryannitz.org/tech-notes/2009/01/19/mysql-and-negative-infinity/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/01/19/mysql-and-negative-infinity/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 02:12:09 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=118</guid>
		<description><![CDATA[Storing and retrieving negative infinity in a MySQL database is accomplished by inserting an arbitrarily large negative number.  Negative infinity is handy when storing default values in a database. The following SQL statement is an example of inserting negative infinity: INSERT INTO test(negative_infinity) VALUES('-1e500'); Here is the test table: CREATE TABLE test (      negative_infinity [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-15" title="mysql" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg" alt="mysql" width="124" height="90" /></p>
<p>Storing and retrieving <a href="http://en.wiktionary.org/wiki/infinity" target="_blank">negative infinity</a> in a MySQL database is accomplished by inserting an arbitrarily large negative number.  Negative infinity is handy when storing default values in a database.</p>
<p>The following SQL statement is an example of inserting negative infinity:</p>
<pre>INSERT INTO test(negative_infinity) VALUES('-1e500');</pre>
<p>Here is the test table:</p>
<pre>CREATE TABLE test (
     negative_infinity DOUBLE NOT NULL
) ENGINE=INNODB character set utf8;</pre>
<p>The value in the database is stored as the maximum negative value for the data type, double (-1.79769313486232e+308).</p>
<pre>mysql&gt; select * from test;
+------------------------+
| negative_infinity      |
+------------------------+
| -1.79769313486232e+308 |
+------------------------+
1 row in set (0.00 sec)</pre>
<p>In Java, the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Double.html" target="_blank">Double contsant</a> for max infinity, directly correlates to the value stored by MySQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/01/19/mysql-and-negative-infinity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Update Table Limit Rows</title>
		<link>http://www.ryannitz.org/tech-notes/2008/12/09/mysql-update-table-limit-rows/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/12/09/mysql-update-table-limit-rows/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 19:20:07 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=77</guid>
		<description><![CDATA[Updating a block of rows in MySQL can be accompished by using the &#8220;limit&#8221; function: update TABLE_NAME set COLUMN_NAME=VALUE limit MAX; E.g. update products set state=false limit 10;]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg"><img class="alignnone size-medium wp-image-15" title="mysql" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg" alt="" width="124" height="90" /></a></p>
<p>Updating a block of rows in MySQL can be accompished by using the &#8220;limit&#8221; function:</p>
<pre>update TABLE_NAME set COLUMN_NAME=VALUE limit MAX;</pre>
<p>E.g.</p>
<pre>update products set state=false limit 10;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/12/09/mysql-update-table-limit-rows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebuild An InnoDB Table Index</title>
		<link>http://www.ryannitz.org/tech-notes/2008/12/03/rebuild-an-innodb-table-index/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/12/03/rebuild-an-innodb-table-index/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 02:18:21 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=74</guid>
		<description><![CDATA[Rebuilding an InnoDB table index is easy in MySQL 5.0. Simply type: mysql&#62; ALTER TABLE table_name ENGINE=InnoDB; Warning: When dealing with large databases, this can place a lot of load on your DB.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg"><img class="alignnone size-medium wp-image-15" title="mysql" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg" alt="" width="124" height="90" /></a></p>
<p>Rebuilding an <a href="http://en.wikipedia.org/wiki/InnoDB">InnoDB</a> table index is easy in MySQL 5.0. Simply type:</p>
<pre>mysql&gt; ALTER TABLE table_name ENGINE=InnoDB;</pre>
<p>Warning: When dealing with large databases, this can place a lot of load on your DB.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/12/03/rebuild-an-innodb-table-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Increase Column Size</title>
		<link>http://www.ryannitz.org/tech-notes/2008/11/17/mysql-increase-column-size/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/11/17/mysql-increase-column-size/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 02:31:39 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[alter]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=65</guid>
		<description><![CDATA[An example of modifying a MySQL table to increase a VARCHAR column size: alter table TABLE_NAME modify COLUMN_NAME VARCHAR(1024) NOT NULL; This increases COLUMN_NAME to 1024 characters.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg"><img class="alignnone size-medium wp-image-15" title="mysql" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg" alt="" width="124" height="90" /></a></p>
<p>An example of <a href="http://dev.mysql.com/doc/refman/5.0/en/alter-table.html">modifying a MySQL table</a> to increase a VARCHAR column size:</p>
<pre>alter table TABLE_NAME modify COLUMN_NAME VARCHAR(1024) NOT NULL;</pre>
<p>This increases COLUMN_NAME to 1024 characters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/11/17/mysql-increase-column-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Drop Unique Constraint</title>
		<link>http://www.ryannitz.org/tech-notes/2008/11/17/mysql-drop-unique-constraint/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/11/17/mysql-drop-unique-constraint/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 02:03:45 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[alter]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=60</guid>
		<description><![CDATA[In MySQL 5.0 it is possible to drop unqiue constraints but, the syntax is not incredibly intuitive. alter table TABLE_NAME drop index UNIQUE_CONSTRAINT_NAME; Code Ghar provides a more thorough description.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg"><img class="alignnone size-medium wp-image-15" title="mysql" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg" alt="" width="124" height="90" /></a></p>
<p>In MySQL 5.0 it is possible to drop unqiue constraints but, the syntax is not incredibly intuitive.</p>
<pre>alter table TABLE_NAME drop index UNIQUE_CONSTRAINT_NAME;</pre>
<p>Code Ghar provides a more <a href="http://codeghar.wordpress.com/2008/03/28/drop-unique-constraint-in-mysql/">thorough description</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/11/17/mysql-drop-unique-constraint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create MySQL Database and User</title>
		<link>http://www.ryannitz.org/tech-notes/2008/06/16/create-mysql-database-and-user/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/06/16/create-mysql-database-and-user/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 15:11:29 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=13</guid>
		<description><![CDATA[Below are the steps to create a MySQL database and add a user CREATE DATABASE testdb CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY 'sumthin' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'localhost' IDENTIFIED BY 'sumthin' WITH GRANT OPTION; All commands are executed in the MySQL console.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg"><img class="alignnone size-medium wp-image-15" title="mysql" src="http://ryan-nitz.com/tech-notes/wp-content/uploads/2008/06/mysql.jpeg" alt="" width="124" height="90" /></a></p>
<p>Below are the steps to create a MySQL database and add a user</p>
<pre>CREATE DATABASE testdb CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY 'sumthin' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'localhost' IDENTIFIED BY 'sumthin' WITH GRANT OPTION;</pre>
<p>All commands are executed in the MySQL console.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/06/16/create-mysql-database-and-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
