Monday, December 22, 2008

import/export mysql database between window and linux

C: > mysqldump -u -p database_name > /path/to/filename.sql

This should create filename.sql which you can then run on the Linux machine as follows:

Start the mysql client and then, at the mysql prompt:

mysql> CREATE DATABASE database_name;

mysql> USE database_name;

mysql> source /path/to/filename.sql

This should execute filename.sql which will recreate the database.

No comments:

Post a Comment