Page 1 of 1

Export a database

Posted: Tue Mar 18, 2003 11:56 am
by micknic
I created a database of six tables for an intranet. Now I would like to export this database to the server. How to do?? Do I just have to copy the MYI, MYD and FRM files on the server???

Thank you very much

Posted: Tue Mar 18, 2003 3:13 pm
by daven
What type of DB are you using? MySQL, PostGreSQL, MS-SQL, Oracle, etc?

Posted: Wed Mar 19, 2003 2:51 am
by micknic
I use a MySQL database. I hope you can help e

Posted: Fri Mar 21, 2003 3:08 am
by haagen
It's simple.

You have to use a programm called mysqldump.

Så on your development machine you'll write

mysqldump databasename > scriptfile.sql

And on your intranetserver you write.

mysqladmin create databasename
cat scriptfile.sql | mysql databasename

I assume you use Unix. But I assume thate the mysqldump program is included in the windows dist as well.

Read the manual for mysqldump, it can bu configured not to include data and just the schema and so on.

Good Luck!

Posted: Mon Mar 24, 2003 6:10 am
by ckuipers
This is what I usually do:

mysqldump --opt -u username --password=yourpass database > backup-file.sql
You can read this back into MySQL with:

mysql -u username --password=yourpass database < backup-file.sql


Make sure you don't put a space between the '=' and 'yourpass' otherwise it won't work.