Netismine

Tips & Tricks

Import large database to mySQL

There are really many approaches on how to import a 500MB database. Some use mysql command line, some use GUI clients. What I found out to be the quickest way is to log in to mysql console, create a database and execute source command:

$ mysql -u root
 
mysql > create database my_db;
Query OK, 1 row affected (0.00 sec)
 
mysql > use my_db;
Database changed
 
mysql > set names utf8;
Query OK, 0 rows affected (0.00 sec)
 
mysql > source path_to_big_sql_dump.sql
....
select all
1 comment

One Response to Import large database to mySQL

  1. Igor Sidorenko says:

    Will it more quickly than:
    $ mysql -u root my_db < path_to_big_sql_dump.sql

    ?

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> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">