Thursday, February 12, 2015

importing .sql file into a database using wamp



















when you have a sql file you can easily import it in to a database Using wamp.

1. left click wamp -> phpmyadmin
2. select database then click import (top right)
3. locate the database and click go.
You can use the command prompt as well. For that,

1. Run the cmd (DOS) and get into the mysql folder, which in my case works like this
C:\>cd C:\wamp\bin\mysql\mysql5.0.51b\bin
2. Then use this command to fire up MySQL

C:\wamp\bin\mysql\mysql5.0.51b\bin>mysql.exe -use databasename -u username -p

you should provide a password if you have one.
After that copy .sql file to directory where mysql.exe is located and run the command ,
mysql> source myfilename.sql;

No comments:

Post a Comment

Optimize you working enviorenment : Single command to create & move to a directory in linux (C Shell, Bash)

Usually move to a directory just after creating is bit of a anxious task specially if the directory name is too long. mkdir long-name-of...