Archive for the ‘Advanced’ Category

About a month ago I needed to compare tens of thousands of tables in hundreds of databases between a few different servers. The obvious choice was, mk-table-checksum! The only problem was, that the tool needs to know the minimum and maximum value of the column by which each table is to be subdivided into chunks [...]

Warning, the following is quite ugly, but does the job :) A while back I needed to create an archive slave database from a half a terabyte myisam master and had space restrictions. I could not dump the db, load it, then drop keys (archive doesn’t support keys apart from a primary key on one [...]

Lets paint the picture: Scenario part 1 : Migrating a couple thousand stored procedures from database technology X to mysql Scenario part 2 : Legacy system where the people who wrote it left a long time ago Scenario part 3 : Developers sure can get real creative and invent all kinds of ways to get [...]

Are you doing some datetime manipulation or maybe you are migrating from some database technology to MySQL or possibly using milliseconds? Here is an example on how to go about it: Say you have the following date: MAR 16 2008 09:12:51:893AM SELECT DATE_FORMAT(STR_TO_DATE(‘MAR 16 2008 09:12:51:893AM’,'%M %d %Y %h:%i:%s:%f%p’),’%Y%m%d%k%i%s.%f’); –> 2008031691251.893000 What if its PM [...]