Solve the site phpmyadmin unable to import large database

Source: Internet
Author: User
Keywords Network programming Mysql tutorial
Tags .mall backup data database file database structure download export file

In fact, previously wrote a solution phpmyadmin unable to import large files, however, some things, if not thoroughly, or there will be a large number of users do not understand how to operate. So I only tell the steps below, no longer speak any principle, it turns out that any principle, understand people do not need to see, do not understand people they will not see, even if the principle is very simple.

Consider using the king of empire backup can ignore this article, but the method is still worth learning about.

First in the original phpmyadmin mysql database derived in two steps

Please export in two steps

The first step: export database structure. Database structure file is generally small, almost impossible to exceed 2M, so you can directly in another phpmyadmin direct recovery;

The second step: export data content. If this file is too large, you can use cosbeta to write the program to restore (download the program at the end of this page, do not worry, please read the steps to download).

Export the database structure

Into phpmyadmin, according to the following screenshots to export the data:

1. Click the name of the database you want to export

Click the Export button.

Choose Export Structure Only

Look carefully at the options above, you just need to remove the data that hook can be. Just export the data on the contrary, the structure hook removed, the data check on

Download the database structure

Database structure file is very small, so you can get a few seconds generally.

Export the contents of the database

1. Enter phpmyadmin, according to the following screenshots to export the data:

Look carefully at the above options, you only need to remove the structure that hook can be.

Download the database contents

Because you need to read my log, so your database file should not be small, please be patient to download.

Import the database structure

Also restore the database in two steps: 1. Restore the database structure; 2. Restore the contents of the database;

As the structure of the backup file is very small, so restore the structure directly in the phpmyadmin recovery, recovery process see below:

Select the database structure file

Import database data

The focus of this article, the reason why you look at this blog, because your data is too large, can not directly phpmyadmin, import, so I specifically wrote a script that you can import directly on the server.

Import method (please ensure that the database structure has been imported into a new database):

1. Download this file import, unzip it and place it in the root directory;

2. Use Notepad to open import.php, modify the first 4 lines, you should know how to modify, that is, the database password and database user name, etc. to fill in the normal;

3. Unzip the contents of the database file that has been backed up just now, rename it to db.sql, and upload it to the root of the site.

4. Open your site http: // your domain name / import.php, if set correctly, the database will be imported within seconds, even if the 10M database will not time out.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.