Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No SQL option on Export of a table in PHPMyAdmin

PHPMyAdmin is showing some strange results when I go to export a table as SQL. If I go to the main database and select Export (i.e. the whole database) at the top it works as expected but when I go to a table and try end export just that table, there is no SQL option in the select list on the "Format:" section.

enter image description here

I am using Server version: 5.5.62(MySQL) and phpmyadmin 4.8.4. This is server wide (happening on all db's on this server)

There is a workaround, I can go to the main database level and export all and only tick the options of the tables I want but want to get this to work.

I have read about a max_input_vars setting but if this was the case, it would not export the whole DB, this just happens at a table level.

Thanks in advance

like image 256
Keith Ivison Avatar asked Dec 31 '18 08:12

Keith Ivison


3 Answers

The fix does work, have applied it to many servers at this point.

Fix # 14775 : edit 'Export.php'

Resolution:

Connect to the server via SSH.

Open file:

/usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/classes/Display/Export.php with a text editor.

Note: for Windows, it will be

%plesk_dir%admin\htdocs\domains\databases\phpMyAdmin\libraries\classes\Display\Export.php.

Find line /* Scan for plugins */

Add the following above the line:

// Export a single table
if (isset($_GET['single_table'])) {
    $GLOBALS['single_table'] = $_GET['single_table'];
}
like image 83
vsw Avatar answered Oct 02 '22 22:10

vsw


This is caused by a bug in version 4.8.4 of phpmyadmin. ppmyadmin team are working on it in this github issue.

There seems to a workaround available (I did not test it myself) : if I select the db, then checkbox the table(s), exporting under "with selected" I get the SQL option.

like image 28
GMB Avatar answered Oct 03 '22 00:10

GMB


I am using xampp in ubuntu locally and I don't have /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/classes/Display/Export.php file. SO I searched about this file and I found it here: /opt/lampp/phpmyadmin/libraries/classes/Display/Export.php After editing this file from the

// Export a single table
if (isset($_GET['single_table'])) {
$GLOBALS['single_table'] = $_GET['single_table'];
}

(as the first answer) resolved my problem.

like image 21
Shan Chathusanda Jayathilaka Avatar answered Oct 02 '22 23:10

Shan Chathusanda Jayathilaka