Murvat R
Murvat R

Reputation: 121

Cannot export table in SQL format in 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

Upvotes: 11

Views: 17867

Answers (8)

nikos83
nikos83

Reputation: 423

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

Upvotes: 14

Shoooryuken
Shoooryuken

Reputation: 340

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

Upvotes: 1

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'];
}

Upvotes: 2

Chethan Gowda
Chethan Gowda

Reputation: 101

Code is present in the script, just Change POST to REQUEST method

if (isset($_REQUEST['single_table'])) {
$GLOBALS['single_table'] = $_REQUEST['single_table'];
}

Upvotes: 0

mohamed elshazly
mohamed elshazly

Reputation: 548

In xampp file Export.php:

/opt/lampp/phpmyadmin/libraries/classes/Display

Upvotes: 0

vsw
vsw

Reputation: 452

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.

Upvotes: 21

e-israel
e-israel

Reputation: 646

Another way to export is using CLI:

mysqldump -u your_user -p your_database table1 table2 ... > database_tables.sql

Upvotes: 1

Ruslan Mikhno
Ruslan Mikhno

Reputation: 41

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).

Upvotes: 4

Related Questions