Quantcast
Channel: Planet MySQL
Viewing all articles
Browse latest Browse all 18841

Migrating from MySQL to Drizzle

$
0
0

One of Drizzle’s great strengths is that it is not afraid to deviate from its MySQL origins.  Unfortunately the side-effect of this is that it can make migration from MySQL to Drizzle more difficult.  I have previous noted that drizzledump can so the schema migration for you.  Now I will go into more details with some other information that may be useful if you are considering migration.

The first thing I should point out is that the default storage engine in Drizzle in InnoDB, MyISAM exists only for temporary tables and we have some other options such as PBXT and BlitzDB.  As a kind-of side effect to this, there is no FULLTEXT indexes in Drizzle, so these have to be dropped as part of the migration.

When it comes to integer types we have two, INT and BIGINT.  So TINYINT, SMALLINT, etc… need to be changed to INT.  We also have no unsigned so an INT UNSIGNED needs to become BIGINT to prevent potential loss of data.  Finally INT doesn’t have column widths, for example the bit in braces in “INT(11)” so these can go.

There are also several changes to TIME/DATE storage.  There is no TIME type in Drizzle, so Drizzledump converts this into an INT of seconds.  MySQL accepts a date of 0000-00-00 whereas Drizzle’s minimum date is 0001-01-01.  So Drizzledump converts 0000-00-00 to NULL.  Finally we have no YEAR data type in Drizzle.  This should convert to INT using Drizzledump but as I am writing this I have found a bug here which I will fix shortly.

As far as TEXT/BLOB types go there is no tiny/medium/long.  This is now just BLOB or TEXT.

We have one single character set in Drizzle, UTF8.  So you should make sure data is exported in that character set.  Different collations, however, are supported.

When you want to connect up your application to Drizzle, there is good news here.  Drizzle supports the MySQL protocol and listens on port 3306!  This means, for example, that your PHP app will connect straight to Drizzle thinking it is a MySQL server using the MySQL functions you are familiar with.  There is no UNIX socket, so make sure your apps connect to 127.0.0.1 instead of localhost for local connections.  There is no username/password by default but you can enable one of the authentication plugin modules if you require them.

The query syntax is pretty much the same as MySQL, there are things we don’t have such as stored procedures and triggers.  But for the most part this is unchanged.


PlanetMySQL Voting: Vote UP / Vote DOWN

Viewing all articles
Browse latest Browse all 18841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>