Rick Mann wrote:

I have a DB where all of the tables are InnoDB, and there are a few
straightforward FOREIGN KEY constraints. I would like to use mysqldump to
back up the data or move it to another machine.

The problem I'm running into is that when I try to import the data using
mysql, the data is imported in the order in which it was dumped, that is to
say, alphabetically by table.

This doesn't sound right at all.
mysqldump should also be dumping the primary keys, so it doesn't matter what order they're dumped / imported in, because they get the same primary key. Are you sure this isn't happening? Maybe post the table def and a few lines of a mysqldump file.


This ends up violating the key constraints. Is there a way to specify the
order in which tables are dumped from mysqldump?


You can specify a particular table, eg:
mysqldump databasename tablename
As for the order of records, no. Can't do that. But you shouldn't have to.

I also notice that in the dump, there are what appear to be statements
disabling keys, but they're commented out. (I'm dumping from version
3.23.51). How can I get these statements to be not commented out, and will
that help? Also, in the comment, there is a !40000. What does that mean?


I think mysql reads the 'disable keys' command even though they are commented out.
Not sure what the !40000 means. Maybe has something to do with the version of mysql / mysqldump you have.


Finally, I have INT UNSIGNED AUTO_INCREMENT primary keys in my tables, and
if I try to mysqlimport from a file that has a value of "0", instead of
writing the row like that, it picks a new value for that column. Is there
any way to get mysqlimport to import exactly as written, rather than
auto-incrementing?


I was under the impression that auto_increment fields started at 1. Maybe when mysql gets told to put a zero in there it assumes you want it to auto-increment. Dunno. Never tried it. Do you have quotes around the zero?

Thanks very much for any help.



's OK

--
Daniel Kasak
IT Developer
* NUS Consulting Group*
Level 18, 168 Walker Street
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: www.nusconsulting.com


--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to