Home >Database >phpMyAdmin >What to do if the database file cannot be imported into phpmyadmin

What to do if the database file cannot be imported into phpmyadmin

藏色散人
藏色散人Original
2020-04-06 10:03:383416browse

What should I do if the database file cannot be imported into

What to do if the database file cannot be imported into phpmyadmin

phpmyadmin?

The following is my personal understanding. I don’t know if it is correct. It is just my personal one-sided opinion. I think it is right after tinkering with it.

In order to successfully use the phpmyadmin tool to import the database in the PHP space, before importing, we should do one thing, modify the header file of the .sql backup database. The header file records the information of your original database (database name, user, etc.). Since the name of the mysql database you want to import (the currently used mysql) is definitely inconsistent with the original database, this will cause problems when we import data. , prompt error. I think this is the cause of the error, I don't know if it is the correct answer. Personally, I have always believed that this is the reason, and I hope experts can clearly point out the reason.

According to my above analysis, I also successfully solved many import error problems. The following are my modifications to the .sql database. The modification process is very simple. If you fail to import the mysql database and an error is displayed, you might as well give it a try.

Example: There is a valid mysql database backup file 51php.sql with the .sql suffix that was backed up by another server through phpmyadmin. Now we need to import it into the newly created mysql database in the vip worry-free php virtual host.

Operation steps:

1. Use the text editor editplus to open the 51php.sql file, delete all the header information, and retain only the database table information. As shown below:

What to do if the database file cannot be imported into phpmyadmin

#2. After deleting the header information, the import can generally be successful. If it still fails, use the sql statement of phpmyadmin to import, it is usually OK

The above is the detailed content of What to do if the database file cannot be imported into phpmyadmin. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn