[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving MySQL database from one machine to another and remotely accessing dbs?



Martin Waller wrote:
Hi,

I'm using MySQL 4.1 on Etch and have a database (that I created) on another machine (still Sarge) that I want to transfer to the other before upgrading to etch on that machine also. Where should I look to find out how to do this? Is it just a matter of locating the database and copying or is it more subtle? Are there any security considerations?

On the security note, I'd also like to be able to access the database from other machines but am unable as by default remote access to the server isn't allowed - again, where should I be looking for information on how to change this?

The MySQL docs are pretty daunting for a database newby, and I was hoping there'd be some debian-specific documentation somewhere...

Thanks if anyone can help point me to the relevant information source,

Martin



Martin,

Try using mysqldump to move the databases. The general syntax is something like this:

mysqldump mydatabase > mydatabase.sql

Where "mydatabase" is the name of the database you are dumping. Note that you may need to use the -u and/or -p options if you need to provide a username or password.

After you have transferred this file to the other machine, create a database on that machine with the same name, then run:

mysql mydatabase < mydatabase.sql

Again, substitute "mydatabase" for the actual database name.

I don't run MySQL from the Debian package, so I'm not sure about the remote connection issue.

    - Dave

--

Dave Parker
Utica College Department of
Integrated Information Technology Services
Data Processing Office
(315) 792-3229
Registered Linux User #408177



Reply to: