My MySQL table is something like:
userid(AI,PRIMARY) name password
1 aa dfsdfsdfds
2 ioi kjkjkjkjk
(3) user deleted his account
4 ghghj jhjhkhj
and there is another table with there info
userid( will be userid from above table) address phone
1 sfdsfds 9999999
2 dfsdfdsf 333333
3 (deleted)
4 sdfdsf 999999
When I will backup and restore the data, what will happen what will be my table data of table 1?
When you export your data (i.e. using mysqldump
), all your keys (and their value) are exported as they are. The backup basically looks like this:
CREATE TABLE yourtable (
userid INT(10) unsigned NOT NULL auto_increment,
name VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
PRIMARY KEY (userid)
) AUTO_INCREMENT=5;
INSERT INTO TABLE yourtable ( userid, name, password )
VALUES
(1, 'aa', 'dfsdfsdfds'),
(2, 'ioi', 'kjkjkjkjk'),
(4, 'ghghj', 'jhjhkhj')
As you see in the example:
INSERT
. (the next user will get id 5
)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With