<?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>Sean Behan&#039;s Web Development Portfolio and Blog &#187; Databases</title>
	<atom:link href="http://seanbehan.com/category/databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Development, Wordpress, Moodle, Ruby on Rails and Design in Burlington, Vermont</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:17:12 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dump MySQL Database without Drop Table Syntax</title>
		<link>http://seanbehan.com/databases/dump-mysql-database-without-drop-table-syntax/</link>
		<comments>http://seanbehan.com/databases/dump-mysql-database-without-drop-table-syntax/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 00:57:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[flags]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=781</guid>
		<description><![CDATA[Output .sql file for MySQL but without the drop table syntax before table name use the &#8211;skip-add-drop-table flag

mysqldump -u root -p database_name --skip-add-drop-table --skip-lock-tables > database_name.sql



Related posts:Sample Rails Database Config  for MySQL
Rake DB Everything, Dump, Destroy, Create, Load
NO Table Cell Spacing Please



Related posts:<ol><li><a href='http://seanbehan.com/ruby-on-rails/sample-rails-database-config-for-mysql/' rel='bookmark' title='Permanent Link: Sample Rails Database Config  for MySQL'>Sample Rails Database Config  for MySQL</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/rake-db-everything-dump-destroy-create-load/' rel='bookmark' title='Permanent Link: Rake DB Everything, Dump, Destroy, Create, Load'>Rake DB Everything, Dump, Destroy, Create, Load</a></li>
<li><a href='http://seanbehan.com/programming/no-table-cell-spacing-please/' rel='bookmark' title='Permanent Link: NO Table Cell Spacing Please'>NO Table Cell Spacing Please</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Output .sql file for MySQL but without the drop table syntax before table name use the &#8211;skip-add-drop-table flag</p>
<pre>
mysqldump -u root -p database_name --skip-add-drop-table --skip-lock-tables > database_name.sql
</pre>


<p>Related posts:<ol><li><a href='http://seanbehan.com/ruby-on-rails/sample-rails-database-config-for-mysql/' rel='bookmark' title='Permanent Link: Sample Rails Database Config  for MySQL'>Sample Rails Database Config  for MySQL</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/rake-db-everything-dump-destroy-create-load/' rel='bookmark' title='Permanent Link: Rake DB Everything, Dump, Destroy, Create, Load'>Rake DB Everything, Dump, Destroy, Create, Load</a></li>
<li><a href='http://seanbehan.com/programming/no-table-cell-spacing-please/' rel='bookmark' title='Permanent Link: NO Table Cell Spacing Please'>NO Table Cell Spacing Please</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/databases/dump-mysql-database-without-drop-table-syntax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing Timestamps in MySQL with a Trigger</title>
		<link>http://seanbehan.com/databases/managing-timestamps-in-mysql-with-a-trigger/</link>
		<comments>http://seanbehan.com/databases/managing-timestamps-in-mysql-with-a-trigger/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 17:13:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[timestamping]]></category>
		<category><![CDATA[triggers]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=707</guid>
		<description><![CDATA[MySQL doesn&#8217;t support having two columns with time stamping on both initialization and/or on updating at the same time. It would be nice to be able to do *this* where the created_at column gets the current_timestamp on initialization and the updated_at gets changed on updating the row.

# like so doesn't work...
create table entries(
  body [...]


Related posts:<ol><li><a href='http://seanbehan.com/php/generate-mysql-datetime-type-using-php-date-function/' rel='bookmark' title='Permanent Link: Generate MySQL Datetime Type Using PHP Date() Function'>Generate MySQL Datetime Type Using PHP Date() Function</a></li>
<li><a href='http://seanbehan.com/databases/dump-mysql-database-without-drop-table-syntax/' rel='bookmark' title='Permanent Link: Dump MySQL Database without Drop Table Syntax'>Dump MySQL Database without Drop Table Syntax</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/' rel='bookmark' title='Permanent Link: Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git'>Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>MySQL doesn&#8217;t support having two columns with time stamping on both initialization and/or on updating at the same time. It would be nice to be able to do *this* where the created_at column gets the current_timestamp on initialization and the updated_at gets changed on updating the row.</p>
<pre>
# like so doesn't work...
create table entries(
  body blob,
  created_at datetime default current_timestamp,
  updated_at timestamp default current_timestamp on update current_timestamp
);
</pre>
<p>Seems like a feature a lot of folks would like. There are two work-arounds. The first is baking it into your application code with something like</p>
<pre>
create table entries(
  body blob,
  created_at datetime default null,
  updated_at timestamp default current_timestamp on update current_timestamp
);
insert into entries (body, created_at) values ('hello world', now());
</pre>
<p>The second way is to create a trigger and call the trigger on your insert action on a row. </p>
<pre>
create table entries (
  body  blob,
  created_at datetime default null,
  updated_at timestamp default null on update current_timestamp
);
create trigger init_created_at before insert on entries for each row set new.created_at = now();
</pre>
<p>Now whenever a new row is created the trigger will be executed and set the time to the current timestamp. You can forget about the created_at column in your code because it&#8217;s not meant to be changed.</p>


<p>Related posts:<ol><li><a href='http://seanbehan.com/php/generate-mysql-datetime-type-using-php-date-function/' rel='bookmark' title='Permanent Link: Generate MySQL Datetime Type Using PHP Date() Function'>Generate MySQL Datetime Type Using PHP Date() Function</a></li>
<li><a href='http://seanbehan.com/databases/dump-mysql-database-without-drop-table-syntax/' rel='bookmark' title='Permanent Link: Dump MySQL Database without Drop Table Syntax'>Dump MySQL Database without Drop Table Syntax</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/' rel='bookmark' title='Permanent Link: Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git'>Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/databases/managing-timestamps-in-mysql-with-a-trigger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install do_mysql Ruby Gem on Mac OS X</title>
		<link>http://seanbehan.com/databases/install-do_mysql-ruby-gem-on-mac-os-x/</link>
		<comments>http://seanbehan.com/databases/install-do_mysql-ruby-gem-on-mac-os-x/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 15:19:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[datamapper]]></category>
		<category><![CDATA[do_mysql]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Sinatra]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=523</guid>
		<description><![CDATA[I ran into the same problem when installing mysql gem for Rails development. This fix worked for me http://seanbehan.com/programming/fixing-mysql-for-rails-2-2-development-on-mac-os-x/ 
The same thing works with the data objects gem. Just specify the path the mysql config that it&#8217;s using and the gem should install just fine. 

gem install do_mysql -- --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config



Related posts:Install MySQLdb for Python on [...]


Related posts:<ol><li><a href='http://seanbehan.com/python/install-mysqldb-for-python-on-mac-os-x/' rel='bookmark' title='Permanent Link: Install MySQLdb for Python on Mac OS X'>Install MySQLdb for Python on Mac OS X</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/' rel='bookmark' title='Permanent Link: Install and Serve a Rails Application from PHP Subdirectory Using Apache, Phussion Passenger and Ruby Enterprise Edition'>Install and Serve a Rails Application from PHP Subdirectory Using Apache, Phussion Passenger and Ruby Enterprise Edition</a></li>
<li><a href='http://seanbehan.com/programming/fixing-mysql-for-rails-2-2-development-on-mac-os-x/' rel='bookmark' title='Permanent Link: Fixing MySQL for Rails 2.2 Development on Mac OS X'>Fixing MySQL for Rails 2.2 Development on Mac OS X</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I ran into the same problem when installing mysql gem for Rails development. This fix worked for me http://seanbehan.com/programming/fixing-mysql-for-rails-2-2-development-on-mac-os-x/ </p>
<p>The same thing works with the data objects gem. Just specify the path the mysql config that it&#8217;s using and the gem should install just fine. </p>
<pre>
gem install do_mysql -- --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config
</pre>


<p>Related posts:<ol><li><a href='http://seanbehan.com/python/install-mysqldb-for-python-on-mac-os-x/' rel='bookmark' title='Permanent Link: Install MySQLdb for Python on Mac OS X'>Install MySQLdb for Python on Mac OS X</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/' rel='bookmark' title='Permanent Link: Install and Serve a Rails Application from PHP Subdirectory Using Apache, Phussion Passenger and Ruby Enterprise Edition'>Install and Serve a Rails Application from PHP Subdirectory Using Apache, Phussion Passenger and Ruby Enterprise Edition</a></li>
<li><a href='http://seanbehan.com/programming/fixing-mysql-for-rails-2-2-development-on-mac-os-x/' rel='bookmark' title='Permanent Link: Fixing MySQL for Rails 2.2 Development on Mac OS X'>Fixing MySQL for Rails 2.2 Development on Mac OS X</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/databases/install-do_mysql-ruby-gem-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Redis Server and Client on Mac OS X and Ubuntu</title>
		<link>http://seanbehan.com/databases/installing-redis-server-and-client-on-mac-os-x-and-ubuntu/</link>
		<comments>http://seanbehan.com/databases/installing-redis-server-and-client-on-mac-os-x-and-ubuntu/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 01:48:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[store]]></category>
		<category><![CDATA[value]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=519</guid>
		<description><![CDATA[
wget http://redis.googlecode.com/files/redis-0.900_2.tar.gz
tar xzvf redis-0.900_2.tar.gz
cd redis-0.900
make
mv redis-server /usr/bin/
mv redis-cli /usr/bin/



Related posts:Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git
Installing Feedzirra RSS Parser on Ubuntu 8
Installing Monk on Ubuntu with Ruby Gems



Related posts:<ol><li><a href='http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/' rel='bookmark' title='Permanent Link: Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git'>Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/installing-feedzirra-rss-parser-on-ubuntu-8/' rel='bookmark' title='Permanent Link: Installing Feedzirra RSS Parser on Ubuntu 8'>Installing Feedzirra RSS Parser on Ubuntu 8</a></li>
<li><a href='http://seanbehan.com/monk/installing-monk-on-ubuntu-with-ruby-gems/' rel='bookmark' title='Permanent Link: Installing Monk on Ubuntu with Ruby Gems'>Installing Monk on Ubuntu with Ruby Gems</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<pre>
wget http://redis.googlecode.com/files/redis-0.900_2.tar.gz
tar xzvf redis-0.900_2.tar.gz
cd redis-0.900
make
mv redis-server /usr/bin/
mv redis-cli /usr/bin/
</pre>


<p>Related posts:<ol><li><a href='http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/' rel='bookmark' title='Permanent Link: Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git'>Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git</a></li>
<li><a href='http://seanbehan.com/ruby-on-rails/installing-feedzirra-rss-parser-on-ubuntu-8/' rel='bookmark' title='Permanent Link: Installing Feedzirra RSS Parser on Ubuntu 8'>Installing Feedzirra RSS Parser on Ubuntu 8</a></li>
<li><a href='http://seanbehan.com/monk/installing-monk-on-ubuntu-with-ruby-gems/' rel='bookmark' title='Permanent Link: Installing Monk on Ubuntu with Ruby Gems'>Installing Monk on Ubuntu with Ruby Gems</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/databases/installing-redis-server-and-client-on-mac-os-x-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
