'phpmyadmin exports an .sql file that contains html
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.
Solution 1:[1]
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.
Solution 2:[2]
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;
Solution 3:[3]
This problem is related to very large size of database.
Go to your bin folder and type in cmd:
C:\xampp\mysql\bin>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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jorjani |
Solution 2 | Ravi Chandran |
Solution 3 | Stavros Zogas |