C#
C++
SQL

0 Comments:

Post a Comment



<< Home

Creating or moving a MySQL database

Unlike SQL Server, you cannot reliably move a MySQL database by moving the binary files in the MySQL directory. Instead, you should use the mysqldump utility.

Open a command line window to the MySQL bin directory and make sure both mysql and mysqldump binaries are both present. On Linux this location is likely /usr/local/mysql/bin and on Windows this is most likely C:\Program Files\MySQL\MySQL Server 5.0\

Dump the database using a command like this:
./mysqldump --user=user --password=pw database_name_here > db.sql

Then connect using the MySQL command line client and create the database:
./mysql --user=user --password=pw
create database new_database_name
use new_database_name
source db.sql

Labels: ,

posted by Brian at