Auto-increment is not resetting in MySQL

后端 未结 8 1482
花落未央
花落未央 2020-12-03 17:53

I am trying to set up a script to generate a particular set of test data into my database, at the beginning of which I want to clear the tables concerned without dropping co

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 18:29

    ALTER TABLE tbl DROP COLUMN id;
    ALTER TABLE tbl ADD id INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (id);
    in your phpMyAdmin

提交回复
热议问题