phpMyAdmin: How to import a sql file that is too large?

sql

XAMPP

  1. Create a new database in phpMyAdmin “mydb”
  2. Open cmd
  3. Type “cd C:\xampp\mysql\bin”  without inverted commas and press enter (path to your bin folder of xampp mysql can be different in your computer)
  4. Type “mysql -u root -p mydb < filetoimport.sql” without inverted commas and press enter (root can be replaced with your phpMyAdmin user and give name of your sql file to import with full path in place of  filetoimport.sql. You can copy the location of your file, by right clicking the file and selecting properties)
  5. If you have any password specified for root or user, type it otherwise press enter and wait for few minutes.
  6. Voila! refresh your database in phpMyAdmin and you will see your tables there.

WAMP

  1. Create a new database in phpMyAdmin “mydb”
  2. Open cmd
  3. Type “cd C:\wamp\bin\mysql”  without inverted commas and press enter (path to your mysql folder of wamp can be different in your computer)
  4. Check your mysql version by navigating to above mentioned path (C:\wamp\bin\mysql) and check the folder name (in my case i’m using mysql5.1.53)
  5. Then type “mysql5.1.53\bin\mysql -u root -p mydb < filetoimport.sql” without inverted commas and press enter (root can be replaced with your phpMyAdmin user and give name of your sql file to import with full path in place of  filetoimport.sql. You can copy the location of your file, by right clicking the file and selecting properties)
  6. If you have any password specified for root or user, type it otherwise press enter and wait for few minutes.
  7. Voila! refresh your database in phpMyAdmin and you will see your tables there.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s