PhpMyAdmin export does not include PRIMARY KEY as mysqldump

后端 未结 5 550
遇见更好的自我
遇见更好的自我 2021-02-08 20:06

Export of the struture of the same table with PhpMyAdmin:

`DROP TABLE IF EXISTS `test_apprentis`;
CREATE TABLE IF NOT EXISTS `test_apprentis` (
  `a_id` smallint         


        
5条回答
  •  盖世英雄少女心
    2021-02-08 20:33

    For those that need a solution for this, use the flag --single-transaction during mysqldump, so it will put PRIMARY KEY under CREATE TABLE like follows:

    mysqldump --databases mydatabase --single-transaction -u user -p > ./exported_file_name.sql

提交回复
热议问题