How to import large sql file using command line

Bagaimana untuk import fail sql besar menggunakan command line.

C:\Documents and Settings\Administrator>cd c:\wamp

 Pastikan versi database anda. (*5.1.36: sila masukkan versi mysql anda sendiri)
C:\wamp>cd C:\wamp\bin\mysql\mysql5.1.36\bin      
C:\wamp\bin\mysql\mysql5.1.36\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.36-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


mysql> show databases;
+-----------------------+
| Database              |
+-----------------------+
| information_schema    |
| test                  |
| transport_requisition |
+-----------------------+
23 rows in set (1.16 sec)

db anda belum wujud.

mysql> create ehr;
mysql> use ehr;
(Pastikan lokasi fail anda)
mysql> source C:/ehr.sql;   
 Tekan Enter.
Untuk memastikan database anda dan tables di dalamnya telah berjaya diwujudkan, simply type;

show tables;


 Database berjaya diimport ke local pc anda!

No comments: