copying a mysql database

copying a mysql database

am 18.02.2006 17:00:10 von dave

Hello,
Mysql3 on an fc3 box. I do not have the root password for mysqld yet i
need to copy a database let's call it database1 to database2. This is for a
site testing purpose, it's to be an exact copy of database1, yet the two
databases do not have to be kept in sync after the copy.
Any advice appreciated.
Thanks.
Dave.

Re: copying a mysql database

am 18.02.2006 19:35:47 von Bill Karwin

"Dave" wrote in message
news:ewHJf.160909$PY6.16582@tornado.ohiordc.rr.com...
> Mysql3 on an fc3 box. I do not have the root password for mysqld yet i
> need to copy a database let's call it database1 to database2.

There's a documentation page on resetting the root password:
http://dev.mysql.com/doc/refman/4.1/en/resetting-permissions .html

> This is for a site testing purpose, it's to be an exact copy of database1,
> yet the two databases do not have to be kept in sync after the copy.

I would do this by backing up the existing database using mysqldump, and
restoring the data dump to a different database, using the mysql CLI. It
could also be handy if you are doing testing, because you can use the data
dump file to reset the testing database back to its original state
repeatedly.

This page and its sub-pages talk about backing up and restoring:
http://dev.mysql.com/doc/refman/4.1/en/disaster-prevention.h tml

Regards,
Bill K.

Re: copying a mysql database

am 18.02.2006 19:39:15 von Aggro

Dave wrote:

> need to copy a database

This manual section explain different methods. At least mysqldump should
be usable if you just have permission to the database you wish to copy:

http://dev.mysql.com/doc/refman/5.0/en/disaster-prevention.h tml