PhpMyAdmin export does not include PRIMARY KEY as mysqldump

后端 未结 5 553
遇见更好的自我
遇见更好的自我 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:22

    If you want to revert this behavior to how it used to work, edit the file

    phpMyAdmin/libraries/plugins/export/ExportSql.class.php

    In the file, the code block starting with the below line needs to be skipped

    if (preg_match('@CONSTRAINT|KEY@', $create_query)) {
    

    The easiest way to do that is changing that line to

    if (false && preg_match('@CONSTRAINT|KEY@', $create_query)) {
    

提交回复
热议问题