Posted by: Dakusan
« on: December 01, 2015, 11:33:23 pm »Original post for PHPMyAdmin SQL Export: Key Position can be found at https://www.castledragmire.com/Posts/PHPMyAdmin_SQL_Export:_Key_Position.
Originally posted on: 12/01/15
Originally posted on: 12/01/15
After version 4.2.0.0 (2014-05-08) of phpMyAdmin, it stopped including table’s keys inline within the create table statement, and instead opted to add all the table keys at the very end of the export file by modifying the tables. (See "rfe #1004 Create indexes at the end in SQL export). This behavior has been annoying to many people, including myself, but I never noticed anyone mentioning a fix. I looked into the source and there is a very simple way to restore this behavior to what it originally was.
Edit the file “phpMyAdmin/libraries/plugins/export/ExportSql.class.php”. In it, the code block starting with the below line needs to be skipped
if (preg_match('@CONSTRAINT|KEY@', $create_query)) {The easiest way to do this is changing that line to
if (false && preg_match('@CONSTRAINT|KEY@', $create_query)) {