I dumped all my databases in order to import them into a slave.
mysqldump --all-databases > dump.sql
The import seems to be very very slow. Checking the processlist, I saw a simple insert on a 20 rows table that took 400+seconds.
I had to ignore some big and not critical tables from the dump in order to import in a reasonable time.
I don't understand if I'm doing something wrong, the whole dump was about 800MB and the "big" table I ignored was no more than 170K records, which I don't think it's big at all...
Also I often dump a single database to load it on a testing environment, usually without problem. It seems the --all-databases dump is very slow.
Any suggestion welcome.
-
Share your my.cnf and server spec, please.eroomydna– eroomydna2015年01月26日 22:09:26 +00:00Commented Jan 26, 2015 at 22:09
-
Oh, yes: mysql 5.1.69 on Centos6.4. Nothing configured in my.cnf, no buffer size, just all defaults I guess, which probably is part of the problemGlasnhost– Glasnhost2015年01月27日 12:05:48 +00:00Commented Jan 27, 2015 at 12:05
-
not quite the information needed. The variable options used in the mysql config file and the specification of the server (cpu, ram, hdd[raid,num. of disks, write cache policy])eroomydna– eroomydna2015年01月27日 12:07:29 +00:00Commented Jan 27, 2015 at 12:07
-
just edited now! Nothing in my.cnf and 4GB ram, 1cpu, it's a virtual machine, I don't know about writing policyGlasnhost– Glasnhost2015年01月27日 12:09:03 +00:00Commented Jan 27, 2015 at 12:09
1 Answer 1
I suspect you're suffering 'out-of-the-box' syndrome. For the whole world to know... MySQL config out of the box sucks.
Go to https://tools.percona.com/wizard and create better configuration based on the questions asked in the form. This should provide you with a better starting point. Once the output is generated, add it to your configuration file (/etc/my.cnf) and restart MySQL; review the mysql error log to ensure that your mysql instance started cleanly (beware of paths, permissions and the innodb_log_file_size size differences since that will require disposal of the old ib_log* files before new ones can be created). Once done, try your import again.
-
my pleasure, post back your results and if you can advise further anyone that hits the same issue in the future. :)eroomydna– eroomydna2015年01月27日 18:00:32 +00:00Commented Jan 27, 2015 at 18:00
-
of course I forgot about the innodb_log_file_size change, I had one the worst db crash ever, luckily on my local environment. The tool is good though, just need to be carefulGlasnhost– Glasnhost2015年02月03日 21:09:45 +00:00Commented Feb 3, 2015 at 21:09