[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exporting/ important databases/tables


>Dunno how to do this with straight MySQL

Chaps, I figured this out after sending the post :)  Here's how I did it.

I found out how to do it after looking through manual. In fact I tried it
this way before posting the initial message but I got a duplicate key error
mysql would only create one of the tables.  It turned out to be a problem
where mysql would assign the value of 1 to an auto_increment data type
instead of 0.  I forgot about that, and I therefore I was attempting to have
two field both with a unique id of 1.  So what I did was made the dump,
opened up the dump file, amended it to update first id of 1 to 0 before
creating the other and all works fine and dandy! :)  If you can make sense
of my gibberish well done.

Right anyway here's how I did it:

mysqldump -u username -p databasename > dumpfile.txt

then to import do:

mysql -u username -p databasename < dumpfile.txt

simple as that! :)  All tables are re-created and data inserted.

Josh


-- 
---------------------------------------------------------------------
Please check "http://www.mysql.com/documentation/manual.php"; before
posting. To request this thread, e-mail mysql-thread60347@xxxxxxxxxxxxxxx

To unsubscribe, send a message to:
    <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>

If you have a broken mail client that cannot send a message to
the above address (Microsoft Outlook), you can use:
    http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilot Consulting.