How to import large database files from MySQL

Source: Internet
Author: User
Tags mysql tutorial

How to import a large database tutorial file from MySQL

File Size: 800 MB

Method 1

The above file roughly indicates that when a large file is imported, first check the php tutorial. upload_max_filesize, memory_limit, and post_max_size in the following three parts of the ini configuration file. We recommend that you modify the value slightly greater than the imported large SQL database file. Follow this prompt, I modified the above three in php. after the value in ini, the php environment is restarted. During the next import, although phpmyadmin still shows the maximum import limit: 20,480 KB, the huge 80 Mb database file has been successfully imported.
The phpMyAdmin version is 2.8.1 and the environment is APMServ 5.1.2.


Method 2
Some people say that php. the post_max_size in ini file configuration is a little larger than the database file you want to import. For example, if the database file I want to import is 487 MB, you can change this item: 700 MB, and then use the import function of phpMyAdmin. However, I tried this method and could not work. I then communicated with experienced friends and told them to use the command line mode of the mysql tutorial, the practice is as follows:


1. First, click "start" in the lower left corner of the Computer ----- "run" and enter "cmd" in the box to enter the command line mode;

2. The following interface is displayed:
Microsoft Windows XP [version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.


C: Documents and Settingszxchai>
My php installation kit xampp, which integrates (Apache + MySQL + PHP + PERL)
It is an integrated software package for powerful website building tutorials. In short, it is used to enter your mysql installation directory. My mysql is installed in the E: xamppmysql directory, then, in command line mode (on the black screen), enter the following command:
Microsoft Windows XP [version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.


C: Documents and Settingszxchai> E:


E:> cd xamppmysqlbin


E: xamppmysqlbin> mysql-u root-p

Again, the root in the uplink is my mysql user name, and the command line prompts:

Enter password:

Then enter your mysql password:

Enter password :****

Then press enter to display a prompt:

Welcome to MySQL monitor. Commands end with; or g.

Your MySQL connection id is 1

Server version: 5.1.41 Source distribution


Type 'help; 'or 'H' for help. Type 'C' to clear the current input statement.


Mysql>
In this case, you are prompted that your database is ready for trial, and then enter the database you want to use after mysql>. For example, I have an empty database named testdb in mysql, then I enter use testdb behind mysql>;

That is, mysql> use testdb;

Then press enter, and the following will appear:

Database changed

Mysql>

Enter the location of your mysql database file. For example, if your mysql file is in D: test. SQL

In this case, enter source D: test. SQL as follows:
Database changed

Mysql> source D: test. SQL

Then press enter, and there will be many:
Query OK, 0 rows affected (0.00 sec)

Query OK, 5000 rows affected (1.55 sec)
Until the last appearance:
Mysql>
Your large database file has been successfully imported into the mysql database.

Instance 3

When phpmyadmin imports mysql databases, I cannot import databases larger than 2 MB, and mysql Databases can only import 2 MB at most ..

An error occurred while importing the phpmyadmin database:
You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.


After checking on the internet, I got:
When importing a large file, first check php. upload_max_filesize, memory_limit, and post_max_size in the following three parts of the ini configuration file. We recommend that you modify the value slightly greater than the imported large SQL database file. Follow this prompt, I modified the above three in php. after the value in ini, the php environment (IIS) is restarted. During the next import, although phpmyadmin still shows the maximum import limit: 20,480 KB, a huge database file has been successfully imported.

My environment: win2003 + mysql
PhpMyAdmin-2.10.2

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.