I want to export my database from phpMyAdmin to import it to another server. I go through the steps explained here and here but all I get is a 50kb .sql file that contains a list of errors in HTML. It starts with something like:
`<!DOCTYPE HTML><html lang='en' dir='ltr' class='chrome chrome71'><head><meta charset="utf-8" /><meta name="referrer" content="no-referrer" /><meta name="robots" content="noindex,nofollow" /><meta http-equiv="X-UA-Compatible" content="IE=Edge" /><style id="cfs-style">html{display: none;}</style><link rel="icon" href="favicon.ico" type="image/x-icon" /><link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />`
For reference, here’s a screenshot that shows I’ve checked “Data” and “Structure” for all tables.
I want to be able to export structure and data separately, if possible. I think this is because of a configuration issue but not sure what. I know an alternative is directly using mysql but I’m wondering what I’m doing wrong here.
4
Answers
This is very likely caused by a large database. There are two ways to work around it:
1- Change php.ini to allow large "max_input_vars". You need to restart your services for this to take effect.
2- Directly use mysql. You can use the answer provided here.
I too faced the same issue.
I solved the issue by exporting the tables separately and then the data separately.
While importing the data file,
a. add the below line at the top of the file
SET FOREIGN_KEY_CHECKS = 0;
b. add the below line at the bottom of the file
SET FOREIGN_KEY_CHECKS = 1;
This problem is related to very large size of database.
Go to your bin folder and type in cmd:
C:xamppmysqlbin>mysqldump -u root -p database_name_inPMA > anyDbName.sql
Enter password:your_password_here
If you do not have the password use the command without -p
I resolve problem like this when I:
Open phpMyAdmin and select the database you want to export.
Click on the "Export" tab in the top menu.
In the "Export Method" section, select "Custom – display all possible options".
Scroll down and check the "Show result as text" option.
Scroll down to the bottom of the page and click the "Go" button to export your database
Then copy tekst (in my case it was something like 7000 lines) and paste it to file .sql