Wednesday, 24 December 2008

Import large file into MySQL : use SOURCE command

Just use SOURCE command. Or, if you want to be clever and have system privileges, just copy the original MySQL database file from the origin server and put it into the MySQL data directory of the destination server. MySQL is really a file system and not actually a relational database system and it knows how to read it’s own binary database files.
  • Put the '.sql' file into a convenient location (the MySQL/bin or MySQL/MySQL5.X.XX directory would be perfect)
  • Create/open the destination database in MySQL
  • SOURCE sqlfilename (if you put it outside mysql bin, you probably need the full path)

**********
$ mysqldump -u -p >> somedatabasetable.sql
$ mysql -u -p
mysql> create database `xxxdb`
mysql> use `xxxdb`
mysql> source xxxdb.sql

1 comment:

Anonymous said...

buy tramadol without prescriptions buy tramadol cod next day delivery - tramadol high yahoo answers