Skip to main content
Alexander Mikhailian

Alexander Mikhailian

Faster Mysql dump and restore

It's surprising how many people do not know that their mysql dumps and restores can be faster if they disable autocommits.

Dump

mysqldump mydb --single-transaction >mydb.sql

Restore

(echo "SET autocommit=0; cat  mydb.sql; echo "COMMIT;") | mysql mydb
Tags: 
MySQL
cluster code snippets configuration files proxy 6910p essay autoquotes photosight business idea sysml tomcat 2FA tcp wget space exploration royal fuck-up gay gnu screen data mining community management smtp lexicology mac webdesign design bash htc vocal minority debian cinema BI HTTP journalism russian misc adaptive delivery metro management science ESA security virtualization economics olpc xslt google singapore netbsd ICT translation windows drupalplanet rails perl ruby drupal curl popularity Word omg regress LaTeX MySQL piracy silent majority java apple antwerp networking ukraine software programming flemish vandalism microsoft corporate philosophy papers computational linguistics hall of shame R work jobs freedom politics programming ETL OLAP kiss refactoring standards design patterns SEO belarus encryption patents bsd sysadmin git EU evil belgium email linguistics android docker php ddos udp statistics tall ships race 2010 copyright dictatorship ipfilter version control business legal active record Strategic Autonomy conferences oper.ru flashmob idiots everywhere gmail software project management apache linux hardware mp3 newspeak bricolage struts