Home » Mysql » How to import large Mysql database in phpmyadmin

How to import large Mysql database in phpmyadmin

Import large database file from PhpMyAdmin.

some time we have a large database file (More than 20 MB ) to import from php myadmin. but we are not able to import over database file from PhpMyAdmin.There are three Method to import large database file in phpmyadmin database.

 

Import large MySql database

Method 1: To increse the upload file size  and time from php.ini file

 

Step1: go to  RootPath \Xamp\php\php.ini and open this file on editor

Step 2: find post_max_size=8M and increse the post_max_size=1200 MB

Step 3: Increse upload_max_filesize=1280M

Step 4: Increse max_execution_time = 300      //increase execution time as per your server requirement. 

if you have very large database file than increase the max_allowed_packet of mysql in my.ini to avoid MySQL server gone away error

my.ini file locate  in   Root Path  \Xamp\Mysql\my.ini

increase max_allowed_packet = 100M

 

>Method 2 : To Create a  upload Directory in 

Step 1: Find the config.inc.php file located in the phpmyadmin directory. In my case it is located here:

C:\xamp\phpmyadmin\config.inc.php 

Step 2: Find the line /* Authentication type and info */ 
Step 3 : Add one line after that

$cfg[‘UploadDir’] = 'upload';


Step 4: Create a directory called ‘upload’ within the phpmyadmin directory.

C:\xamp\phpmyadmin\upload\

Step 4: Copy and paste the large sql file into upload directory which you want importing to phymyadmin

Step 5: Go TO phpmyadmin graphical interface and create database name  and select sql file from drop down list from phymyadmin to import.

 

Method 3: Import large Mysql file from command line

step1 : open cmd (command prompet)

Step 2: got to cd c:\xamp\mysql\bin

we have import large database file from command line using  below command 

C:\xamp\mysql\bin\mysql -u {username} -p {databasename} < file_name.sql(with full path)

, , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">