Wednesday, October 9, 2013

Import large SQL File into MySQL Server in XAMP / WAMP

To import a large SQL file into MySQL Server in WAMP, copy the SQL file into "C:\wamp\bin\mysql\mysql5.5.24\bin", and navigate to the "C:\wamp\bin\mysql\mysql5.5.24\bin" in the command line window, then in the command line enter:

mysql -u [username] -p [DatabaseName] < [SQLFileName]

for example, is the [username] is root and [DatabaseName] is mixertruck, and the [SQLFilename] is mixertruck.sql, then the command line is 

mysql -u root -p mixertruck < mixertruck.sql

if the mysql is on a remote server, then use the following command line:

mysql -u [username] -h [HostName] -p [DatabaseName] < [SQLFileName]

No comments:

Post a Comment