Recently I tested several different MySQL upgrade scenarios for the blog posts I wrote about the temporal format upgrade. This required me to create a bunch of tables with datetime/timestamp/time columns in MySQL 5.5 and then physically copy those tables to a MySQL 5.6 or 5.7 database. I created 4 copies of each table to test out InnoDB versus MyISAM and partitioned tables versus non-partitioned tables. MySQL Sandbox made the process easy.
These are the MySQL versions I wanted to test:
5.5.34
5.6.15
5.6.22
5.6.25
5.7.7
I was able to download the latest 5.6 and 5.7 releases here and the older releases here.
Read on for an overview of the MySQL Sandbox commands I used.
~/sandboxes/msb_5_6_22/use test
mysql > \W
Show warnings enabled.
mysql > alter table member
-> add column is_active tinyint not null default 1;
Query OK, 10000000 rows affected, 1 warning (45.43 sec)
Records: 10000000 Duplicates: 0 Warnings: 1
Note (Code 1880): TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format.
123456789101112
~/sandboxes/msb_5_6_25/use test
mysql > \W
Show warnings enabled.
mysql > set global avoid_temporal_upgrade = 'ON';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Warning (Code 1287): '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release.
mysql > alter table members
-> add column is_active tinyint not null default 1;
Query OK, 0 rows affected (15.48 sec)
Records: 0 Duplicates: 0 Warnings: 0