XAMPP的PHPMyAdmin在导出表时忽略AUTO_INCREMENT属性

时间:2015-12-08 07:23:03

标签: mysql phpmyadmin xampp

我要告诉的问题是数据库中的所有表,当我转储数据库时,它会忽略:hackney.stream_body/1属性。我的实际表格如下:

ArrayList<String> arrlist = new ArrayList<String>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        arrlist.add("B");
        arrlist.add("C");
        arrlist.add("D");
        arrlist.add("E");
        arrlist.add("F");
        arrlist.add("G");
        ListView lv = (ListView) findViewById(R.id.listview);
        Button btnShowList = (Button) findViewById(R.id.btnShowList);


        final ArrayAdapter adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, arrlist);
        //Listview adapter
        lv.setAdapter(adapter);




        btnShowList.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (arrlist.size() > 0) {
                    arrlist.remove(arrlist.size() - 1);
                    adapter.notifyDataSetChanged();
                }
            }
        });


    }

但如果我使用PHPMyAdmin转储表,则不会添加我之前提到的AUTO_INCREMENT

导出的.sql文件内容的输出位于:

CREATE TABLE IF NOT EXISTS `departments` (
  `departmentid` int(11) NOT NULL AUTO_INCREMENT,
  `chairid` int(11) NOT NULL,
  `department_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `image` varchar(128) NOT NULL DEFAULT 'default_department.png',
  `url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `active` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

我特别检查过,如果在auto_increment选项中禁用了CREATE TABLE IF NOT EXISTS `departments` ( `departmentid` int(11) NOT NULL, -- AUTO_INCREMENT is missing `chairid` int(11) NOT NULL, `department_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `image` varchar(128) NOT NULL DEFAULT 'default_department.png', `url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `active` tinyint(4) NOT NULL DEFAULT '1' ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; 但是没有,则不是。

2 个答案:

答案 0 :(得分:0)

这已在phpMyAdmin版本4.5。0。1(2015年9月)中修复:

https://github.com/phpmyadmin/phpmyadmin/issues/11492

答案 1 :(得分:0)

我认为它会忽略自动增量,但我浏览了文件,在 sql 的底部我发现它在其他地方更改为自动增量