Doubt.
Backup of the database.
Example:
CREATE DATABASE prova;
CREATE TABLE `test` (`progressivo` tinyint(3) unsigned NOT NULL
auto_increment, `testo` char(50), PRIMARY KEY (`progressivo`) )
TYPE=MyISAM;
insert into test (testo) values ('prova1');
insert into test (testo) values ('prova2');
If I make a delete from < nometabella > and does not come to me reset
the auto_increment (from version 4 is necessary to use truncate) is,
second me, a large anomaly the fact that if I make a backup of the
database with mysqldump and then subsequently (for disastry recovery)
a restoration the database, I do not obtain the same one database of
which I have made the backup. In fact the value of auto_increment
leaves again from 1.
example:
delete from test;
insert into test (testo) values ('prova4');
select * from test;
+-------------+--------+
| progressivo | testo |
+-------------+--------+
| 3 | prova3 |
+-------------+--------+
delete from test;
If
insert into test (testo) values ('prova5')
the value of progressivo is 4
If backup database with mysqldump and delete database prova and
restore it
insert into test (testo) values ('prova5')
the value of progressivo is 1
MysqlDump not create a backup, create a similar database, not equal
database!!!!!
xabaras
Backup of the database.
Example:
CREATE DATABASE prova;
CREATE TABLE `test` (`progressivo` tinyint(3) unsigned NOT NULL
auto_increment, `testo` char(50), PRIMARY KEY (`progressivo`) )
TYPE=MyISAM;
insert into test (testo) values ('prova1');
insert into test (testo) values ('prova2');
If I make a delete from < nometabella > and does not come to me reset
the auto_increment (from version 4 is necessary to use truncate) is,
second me, a large anomaly the fact that if I make a backup of the
database with mysqldump and then subsequently (for disastry recovery)
a restoration the database, I do not obtain the same one database of
which I have made the backup. In fact the value of auto_increment
leaves again from 1.
example:
delete from test;
insert into test (testo) values ('prova4');
select * from test;
+-------------+--------+
| progressivo | testo |
+-------------+--------+
| 3 | prova3 |
+-------------+--------+
delete from test;
If
insert into test (testo) values ('prova5')
the value of progressivo is 4
If backup database with mysqldump and delete database prova and
restore it
insert into test (testo) values ('prova5')
the value of progressivo is 1
MysqlDump not create a backup, create a similar database, not equal
database!!!!!
xabaras