How to import a large sql file using PHPMyAdmin on Windows Server 2008

By default you can import a sql file up to 2mb in size. Most of the time you will have a larger filesize due to all the content your website will be storing. There are 2 ways you can overcome this limitation. Either use the mysql command line (it really isn't that scary to use!) or increase the file upload limit in PHP.

First Option:

FTP up the sql file to the server.

Log into your server. Locate the file you just FTP'd and cut and paste it to the root level of your C:\.

Open MySQL command prompt by going to Start -> All Programs -> MySQL -> MySQL command prompt. A DOS like window will appear and as for the admin database password. Enter this and you will be logged into MySQL.

Now simply type: use databasename (where databasename is the name of the database you want to import into) and press enter

The prompt will let you know that you have switched to the database you entered.

Next type: source c:\filename.sql (where filename.sql is the name of the file you copied to the root level) and hit enter.

The database sql will now be imported by mySQL.

Second Option:

Use the steps in my PHP guide to increase the upload size allowed by PHP (about half way through the guide). This will let you upload larger files through the PHPMyAdmin panel.

Share this post

blog comments powered by Disqus


Follow me online at TwitterFacebook or Flickr. If you want to get in touch with me try emailing me.

Latest Tweets