to transfer a database from one mysql server to another

Dups

New Member
Hello,
I am having a database on mysql server on my linux machine. Now I have to transfer it to another mysql server on another linux machine? How is it possible? Please help.

Thank u
Dups

Now I have transferred the related files from /var/lib/mysql/database via ftp to the new machine. But a message is shown as below when I "use database".

"no fields in table1"
"no fields in table2"

These are the tables which I have downloaded via ftp.

Now when I do a query on a table which I passed via ftp,
the following message is shown:
"can't find file ./test/table1.frm".

But the file "table.frm" is present in the test directory.My database is named test.
Thank u
Dups.

[Edited by Dups on 12 Jan 2001 at 02:42 AM]
 

Chris Kelleher

Administrator
Staff member
Here you go:

Step One - Backup current database
[*]telnet into your system
[*]from the root directory, type mysqldump -uUSERNAME -pPASSWORD databasename > /path/to/dump.txt;
[*]this should only take no more than 30 seconds
[*]when it is completed, it will bring you back to the prompt
[*]verify that you have a dump.txt in the /path/to area you specified

Step Two - Transfer to new server
[*]telnet into machine1, and from the command prompt do the following:
[*]machine1$ cd /path/to/yourbackupdirectory
[*]machine1$ ftp machine2 (IP or host) - this should open a connection and ask for your username/password
[*]ftp> bin
[*]ftp> cd /path/to/newdirectory
[*]ftp> put dump.txt (should take no more than 30 seconds)
[*]ftp> close
[*]ftp> quit
[*]verify dump.txt is in the /path/to/new area on the new server

Step Three - Restore to new server
[*]telnet into machine
[*]create new database on the mysql (either via phpMyAdmin or telnet)
[*]from the root, type mysql -uUSERNAME -pPASSWORD newdbname < /path/to/dump.txt
[*]this takes a couple of minutes, but you can track the progress either by FTP (checking the /mysql/data/newdbname and see the files appearing) or by phpMyAdmin (you should see the files appearing there)
[*]when it is completed, it will bring you back to the prompt

That's it, then you're ready to go.

Chris
 

Dups

New Member
Hello,
Thank you very much. I could do the database transfer. But it showed some error when I used dump.txt as the dump file. Insted when I used dump.ISD as my dump file it worked. Thank you very much.

Thank u again
Dups
 
Top