MySQL Import a large database file method

Source: Internet
Author: User
Tags mysql tutorial php tutorial mysql import phpmyadmin

MySQL Import a large database tutorial file method

File Size 800MB

Method One

The above document generally means that, when you encounter a large import file, first check the PHP tutorial. ini configuration file in the following three places, Upload_max_filesize, Memory_limit and Post_max_size, and recommended that the modified value slightly larger than the import of the huge SQL database files; According to this prompt, I modified the above three values in php.ini, restart the PHP environment, import again, although phpMyAdmin still show the import maximum limit: 20,480 KB, However, the huge 80M database files have been successfully imported.
The phpMyAdmin version is 2.8.1, Environment: Apmserv 5.1.2


Method Two
Some people say that the php.ini file configuration of the post_max_size change than you want to import a larger database file, such as now I want to import the database file is 487MB, then you can change this to: 700MB, Then use the phpMyAdmin tool's import function to implement, but I tried this method does not work, and then with experienced friends, tell, use the MySQL tutorial command-line mode, practice is as follows, the detailed steps are as follows:


1. First point the lower left corner of the computer "start"-----"Run" in the box input "cmd" into the command line mode;

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

(C) Copyright 1985-2001 Microsoft Corp.


C:documents and Settingszxchai>
My PHP-Installed suite XAMPP, it integrates (Apache+mysql+php+perl)
is a powerful build station tutorial integrated software package, in short is into your MySQL installation directory, my MySQL installed in e:xamppmysql this directory, and then in the command line mode (that is, black screen) input 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 uplink root is my MySQL username, the command line appears with a prompt:

Enter Password:

Then enter your MySQL password later:

Enter Password: * * *

Then, when you enter, a prompt will appear:

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>
At this point is to prompt you that the database is ready to try, and then enter the database you want to use after mysql>, for example, I have an empty database in my MySQL named TestDB, and then I input use testdb behind mysql>;

That is:mysql> use TestDB;

And then hit enter, and it will appear:

Database changed

Mysql>

Then enter your MySQL database file, such as your MySQL file is in the D:test.sql

So at this point you should enter source D:test.sql as follows:
Database changed

Mysql>source D:test.sql

And then you hit the car and there are a lot of them:
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

Example Three

phpMyAdmin import MySQL database, my far greater than 2M database can not import, MySQL database can only import 2M.

phpMyAdmin Database Import Error:
You are probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.


Through the internet to find out, get:
When you encounter a large import file, first check the following three places in the php.ini configuration file, Upload_max_filesize, Memory_limit, and Post_max_size, and recommend that the modified value be slightly larger than the imported large SQL database file ; Following this hint, I have modified the above three values in php.ini, restarted the PHP environment (IIS), while importing again, although phpMyAdmin still shows the import maximum limit: 20,480 KB, but the 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.