How to import large capacity. sql files with phpMyAdmin

Source: Internet
Author: User
Tags phpmyadmin

Many use Php+mysql station webmaster friends, often to use the phpMyAdmin database management tools to back up and restore the database, when the site runs for a long time, the MySQL database will be very large, when the site encountered problems, need to use phpMyAdmin to recover the database, However, when importing large SQL files, due to the limitations of the PHP upload file and the response time of the script can not be imported, will show failure, but we have to import to the MySQL database, how to do? The following by me for everyone to explain it, can help to the needs of webmaster friends!

Tools/Materials
    • MySQL management tool phpMyAdmin
    • MySQL file
    • notepad++
Method/Step
  1. 1

    Under the phpMyAdmin directory, Find the config.inc.php file in the root directory, if there is no config.inc.php file, you can copy the config.sample.inc.php file in the root directory, rename it to config.inc.php, save it! :

  2. 2

    Then open the config.inc.php file with notepad++, find the code

    $cfg [' uploaddir '] = ';

    This parameter is set to import large SQL file storage directory, here the value is set to: Importbigsql, the code is:

    $cfg [' uploaddir '] = ' importbigsql ';

    Then save the file:

  3. 3

    Next we create a folder named Importbigsql in the phpMyAdmin directory:

  4. 4

    Put the SQL database file that we need to import into the Importbigsql folder below:

  5. 5

    Log in to phpMyAdmin, select the MySQL data file you want to import, and click the "Import" button above the navigation bar:

  6. 6

    Select the "Select from Web server upload folder importbigsql/:" option and select the SQL data file that you want to import:

  7. 7

    Finally, click "Execute" to import the large SQL data file you need:

  8. 8

    After a while, phpMyAdmin shows that we need to import the SQL file, import successfully, we need to import the large SQL file and import successfully, you can test the site, whether it can be accessed,:

    END
Precautions
    • If the config.inc.php file is not found $cfg [' uploaddir '] = '; You can add them to the file yourself and fill in the corresponding parameters.
    • The parameter value Importbigsql can be set by itself, but the folder name created by phpMyAdmin is the same as the set parameter value.

How to import large capacity. sql files with phpMyAdmin

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.