Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot export table in SQL format in phpMyAdmin

Tags:

sql

phpmyadmin

I want to export my SQL table from phpMyAdmin, but in my server I cannot choose SQL format because it does not exist.

I also can't export the total SQL file. After I click Go, my browser shows an error.

How I can fix this?

screenshot of problem

like image 837
Murvat R Avatar asked Dec 15 '18 23:12

Murvat R


5 Answers

This is a bug. You can simply, on the first tab, select all the data and click on the export button at the bottom right. The sql option will be defaulted.

like this

like image 86
Shoooryuken Avatar answered Nov 08 '22 02:11

Shoooryuken


They do have a fix in place now:

Resources: Issue 14775 | Fix for 14775

Follow these steps:

  1. Connect to the server via SSH. (I'd recommend saving original file first just in case)
  2. Edit file /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/classes/Display/Export.php.

!Note: for Windows, it will be %plesk_dir%admin\htdocs\domains\databases\phpMyAdmin\libraries\classes\Display\Export.php.

  1. Find line /* Scan for plugins */ (around line 662)
  2. Add the following above the line:

// Export a single table

if (isset($_GET['single_table'])) {

    $GLOBALS['single_table'] = $_GET['single_table'];

}
  1. Save the file.

More references here.

like image 20
vsw Avatar answered Nov 08 '22 01:11

vsw


Until issue is resolved you could try another way: Open the table you would like to export then go all the way down and see Query results operations. In there you could export query result and here is an option with SQL. In my case this works ok.

enter image description here

like image 13
nikos83 Avatar answered Nov 08 '22 01:11

nikos83


If it is phpMyAdmin 4.8.4, then you probably have encountered this issue: https://github.com/phpmyadmin/phpmyadmin/issues/14775

It should be fixed in the next couple of days, with the next update - meanwhile, you could try to use an older version of phpMyAdmin for export or mysqldump (or some other means to export the DB\table).

like image 4
Ruslan Mikhno Avatar answered Nov 08 '22 01:11

Ruslan Mikhno


1. Go to C:\wamp\apps\phpmyadmin(YOUR_PHP_VERSION)\libraries\classes\Display
2. open Export.php
3. look for line /* Scan for plugins */ (near 662)
4. check if following lines are set or not

if (isset($_POST['single_table'])) {
$GLOBALS['single_table'] = $_POST['single_table'];
}
if (isset($_GET['single_table'])) {
$GLOBALS['single_table'] = $_GET['single_table'];
}
like image 2
Vruxsol Web Developers Avatar answered Nov 08 '22 02:11

Vruxsol Web Developers