Antwort: Re: Antwort: Re: Antwort: RE: how to backup mySQL database?
On 28.02.2001 19:51:13 Gerald L. Clark wrote: > In the dump, the autoincrement columns will have their actual values, > not 0. Yes, correct - and if the actual value is 0, it will contain just this. And inserting a row with the col set to 0, will change the column value. TRY IT! - 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
Antwort: RE: Antwort: RE: how to backup mySQL database?
On 28.02.2001 05:58:33 ?US-ASCII?Q?Fabio_Ottolini?= wrote: > mysqldump "spits" not only table structures but data also. When you use > mysql to import data it will first attempt to create the table and then load > its values. If your table's got AUTO_INCREMENT set it will work fine after > recreating the database. Anyway... Give it a try! :) Once more: No, it won't. Again, do this, and you'll see that it will not work correctly - or rather it will work correctly, but the recreated table will have different values. Create a table with one AUTO_INCREMENT column called ID. Insert one row, like so: INSERT INTO Tbl (ID) VALUES (0) Check all the rows: SELECT ID FROM Tbl You'll see that the row's ID column is != 0. Do this to set the column to 0: UPDATE Tbl SET ID=0 WHERE ID = 1 Check all the rows: SELECT ID FROM Tbl Now the row will have the ID set to 0. Dump the table, drop the table, replay the dump. Now you'll have just one row again, but ID will be != 0, because the dump contained the statement "INSERT INTO Tbl (ID) VALUES (0)" - as I just explained, this won't work. Give it a try before you disagree again :-)) - 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
Re: Antwort: Re: Antwort: RE: how to backup mySQL database?
[EMAIL PROTECTED] wrote: > > On 28.02.2001 16:03:57 Gerald L. Clark wrote: > > > But the dump who't have it set to zero, so it will reload with its > > proper value. > > No, in the dump the column will be set to zero, but since "INSERT INTO Tbl > (AutoCol) VALUES (0)" means that AutoCol should be set to the next available > value (if AutoCol is auto_incrementing), the row will *NOT* have AutoCol set to > 0, but to something else. In the dump, the autoincrement columns will have their actual values, not 0. - 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
Antwort: Re: Antwort: RE: how to backup mySQL database?
On 28.02.2001 16:03:57 Gerald L. Clark wrote: > But the dump who't have it set to zero, so it will reload with its > proper value. No, in the dump the column will be set to zero, but since "INSERT INTO Tbl (AutoCol) VALUES (0)" means that AutoCol should be set to the next available value (if AutoCol is auto_incrementing), the row will *NOT* have AutoCol set to 0, but to something else. - 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