|
Posted by patrick on March 7, 2006, 12:41 pm
Please log in for more thread options
Mysql 4.1.15 on Win2k. Using InnoDB.
Using the mysql administrator gui to create a backup, everything goes
fine, and restores quickly.
Using the command line:
show/hide quoted text
mysqldump %dbname% --single-transaction > %dbname%.sql
creates a file about 15% smaller than the gui produces, and is
EXTREMELY slow to restore. I have tried adding locks, skip opt,
everything. What does the gui use for a command to create this dump?
|
|
Posted by Bill Karwin on March 7, 2006, 2:16 pm
Please log in for more thread options
show/hide quoted text
> mysqldump %dbname% --single-transaction > %dbname%.sql
I believe the --single-transaction executes the backup in a single
transaction; it doesn't create a script to execute the restore in a single
transaction.
show/hide quoted text
> creates a file about 15% smaller than the gui produces, and is
> EXTREMELY slow to restore. I have tried adding locks, skip opt,
> everything.
I think you _want_ the --opt option! Did you read the description of --opt?
http://dev.mysql.com/doc/refman/4.1/en/mysqldump.html
There are a large number of tips for InnoDB performance here:
http://dev.mysql.com/doc/refman/4.1/en/innodb-tuning.html
For example, following the tips on that page, I'd do the following (sorry, I
am using UNIX/Linux shell syntax, writing the Windows equivalent is left as
an exercise for the reader):
(
echo "SET AUTOCOMMIT=0;"
echo "SET UNIQUE_CHECKS=0;"
echo "SET FOREIGN_KEY_CHECKS=0;"
cat mydumpfile.sql
echo "SET FOREIGN_KEY_CHECKS=1;"
echo "UNIQUE_CHECKS=1;"
echo "COMMIT;"
) | mysql -u username -p mydatabase
Regards,
Bill K.
|
|
Posted by patrick on March 7, 2006, 4:10 pm
Please log in for more thread options Thanks. I was able to do that from a redhat box I have sitting next to
it. I was under the impression that I need single transaction with
InnoDB. Anyway, thank you.
|
|
Posted by Ian Pawson on March 9, 2006, 4:33 am
Please log in for more thread options patrick@digital-horizons.com wrote:
show/hide quoted text
> Mysql 4.1.15 on Win2k. Using InnoDB.
>
> Using the mysql administrator gui to create a backup, everything goes
> fine, and restores quickly.
>
> Using the command line:
>
> mysqldump %dbname% --single-transaction > %dbname%.sql
>
> creates a file about 15% smaller than the gui produces, and is
> EXTREMELY slow to restore. I have tried adding locks, skip opt,
> everything. What does the gui use for a command to create this dump?
>
The GUI backup has a new INSERT line about every 21 rows, which makes
the file larger but much quicker to restore. I have not been able to get
mysqldump to mimic this behaviour. I only seems to output a single INSERT.
|
|
Posted by Bill Karwin on March 9, 2006, 1:44 pm
Please log in for more thread options show/hide quoted text
> patrick@digital-horizons.com wrote:
> The GUI backup has a new INSERT line about every 21 rows, which makes
> the file larger but much quicker to restore. I have not been able to get
> mysqldump to mimic this behaviour. I only seems to output a single INSERT.
I wonder if this optimization is related to the bulk_insert_buffer_size
server parameter? You may be able to make very long INSERTs run faster if
you increase that buffer. See
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
Regards,
Bill K.
|
| Similar Threads | Posted | | Restore db from 4.1.12 to 3.23 | July 13, 2005, 11:21 am |
| Restore Your Account | August 11, 2005, 1:45 am |
| cannot restore 3.23.58 db to MySQL 4.0.22-debug | November 29, 2005, 3:42 pm |
| mysql backup and restore for 4.1.x | April 16, 2006, 12:22 am |
| mysqldump restore db syntax | April 29, 2006, 4:38 pm |
| Quality of Backup and Restore | June 2, 2006, 3:38 am |
| backup and restore of var lib mysq | February 12, 2009, 2:12 pm |
| What is the fastest way to restore a mysqldumped table? | October 31, 2005, 8:12 pm |
| Database Restore / MySQL 4.1 -- InnoDB | May 1, 2006, 12:11 pm |
| Newbie seeks help using backup/restore | August 11, 2006, 11:59 am |
|