How can I slow down a MySQL dump as to not affect current load on the server?

I have very large databases with tens of thousands of tables some of which have up to 5GB of data in 10’s of millions of entries. (I run a popular service)… I’ve always had headaches when backing up these databases. Using default mysqldump it quickly spirals the server load out of control and locks up … Read more

mysqldump with create database line

By default mysqldump always creates the CREATE DATABASE IF NOT EXISTS db_name; statement at the beginning of the dump file. [EDIT] Few things about the mysqldump file and it’s options: –all-databases, -A Dump all tables in all databases. This is the same as using the –databases option and naming all the databases on the command … Read more

Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!)

Assuming by full dump you also mean the VIEWs and the EVENTs, you would need: GRANT USAGE ON *.* TO ‘dump’@’%’ IDENTIFIED BY …; GRANT SELECT, LOCK TABLES ON `mysql`.* TO ‘dump’@’%’; GRANT SELECT, LOCK TABLES, SHOW VIEW, EVENT, TRIGGER ON `myschema`.* TO ‘dump’@’%’; and if you have VIEWs that execute a function, then unfortunately … Read more

How can I get rid of these comments in a MySQL dump?

WHOA! These aren’t really comments even though they look that way. They are conditional-execution tokens. Take this line: /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; If the version of mySQL is 4.00.14 or higher, then the MySQL server will run this statement. This magic comment syntax is documented in the Comment Syntax section of the manual. You … Read more

tech