--skip-opt
is a useful option to mysqldump
– amongst other things it disables the extended INSERT syntax producing an INSERT per table row. That’s good for examing individual rows in the dump.
However, it also disables --create-options
. This flag prevents any MySQL-specific schema stuff appearing in the dump. Unfortunately (for me, during a live deploy) is that this includes auto_increment:
$ mysqldump --no-data foo_livedb globalize_translations -- MySQL dump 10.9 -- -- Host: localhost Database: foo_livedb -- ------------------------------------------------------ -- Server version 4.1.18-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-- -- Table structure for table `globalize_translations` --
DROP TABLE IF EXISTS `globalize_translations`; CREATE TABLE `globalize_translations` ( `id` int(11) NOT NULL auto_increment, `type` varchar(255) default NULL, `tr_key` varchar(255) default NULL, `table_name` varchar(255) default NULL, `item_id` int(11) default NULL, `facet` varchar(255) default NULL, `language_id` int(11) default NULL, `pluralization_index` int(11) default NULL, `text` text, PRIMARY KEY (`id`), KEY `index_globalize_translations_on_tr_key_and_language_id` (`tr_key`,`language_id`), KEY `globalize_translation_table_item_lang` (`table_name`,`item_id`,`language_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
$ mysqldump --no-data --skip-opt foo_livedb globalize_translations -- MySQL dump 10.9 -- -- Host: localhost Database: foo_livedb -- ------------------------------------------------------ -- Server version 4.1.18-log /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-- -- Table structure for table `globalize_translations` --
CREATE TABLE `globalize_translations` ( `id` int(11) NOT NULL, `type` varchar(255) default NULL, `tr_key` varchar(255) default NULL, `table_name` varchar(255) default NULL, `item_id` int(11) default NULL, `facet` varchar(255) default NULL, `language_id` int(11) default NULL, `pluralization_index` int(11) default NULL, `text` text, PRIMARY KEY (`id`), KEY `index_globalize_translations_on_tr_key_and_language_id` (`tr_key`,`language_id`), KEY `globalize_translation_table_item_lang` (`table_name`,`item_id`,`language_id`) );
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Leave a Reply
Recent articles
- Docker, SELinux, Consul, Registrator
(Wednesday, 04. 29. 2015 – No Comments) - ZFS performance on FreeBSD
(Tuesday, 09. 16. 2014 – No Comments) - Controlling Exim SMTP behaviour from Dovecot password data
(Wednesday, 09. 3. 2014 – No Comments) - Heartbleed OpenSSL vulnerability
(Tuesday, 04. 8. 2014 – No Comments)
Archives
- April 2015
- September 2014
- April 2014
- September 2013
- August 2013
- March 2013
- April 2012
- March 2012
- September 2011
- June 2011
- February 2011
- January 2011
- October 2010
- September 2010
- February 2010
- September 2009
- August 2009
- January 2009
- September 2008
- August 2008
- July 2008
- May 2008
- April 2008
- February 2008
- January 2008
- November 2007
- October 2007
- September 2007
- August 2007
- December 2006
- November 2006
- August 2006
- June 2006
- May 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005