firstruby

Master ruby with us

Import and Export Database to/from MySQL

Posted by firstruby on October 23, 2008

Small stuff about how to import and export data to/from MySQL with the help of mysql and mysqldump commands,

IMPORT database to MySQL,

D:\>mysql -u username -p password database_name < file.sql

database_name should be there in database. Put your username, password and database_name with yours MySQL information. After this command, data from file.sql will be imported to your database.

EXPORT database from MySQL,

D:\>mysqldump -u username -p password database_name > file.sql

Please replace username, password and database_name with yours MySQL information.

After this command, data will be exported to file.sql

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: