My machine with the database is broken. I need to transfer the data to another machine. How do I do that? Copy all the files of the data/ to the new machine, but how to be able to access them again? Before I had host localhost database abc user user1 password secret now the database in on host db ..... bye Ronald
On Tue, 2005-06-07 at 00:43 +0800, Ronald Wiplinger wrote:
My machine with the database is broken. I need to transfer the data to another machine.
How do I do that? Copy all the files of the data/ to the new machine, but how to be able to access them again?
Before I had host localhost database abc user user1 password secret
now the database in on host db .....
bye
Ronald
Use mysqldump to save one or all databases Use mysqlrestore to restore them. Also check the docs at /usr/share/doc/packages/mysql and also at /usr/share/doc/packages/mysql-administrator But then you knew to look in the .../doc/packages for help didn't you? It is a good first place to look for info. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
On Monday 06 Jun 2005 17:43, Ronald Wiplinger wrote:
Copy all the files of the data/ to the new machine, but how to be able to access them again?
If you have access to the old machine, use mysqldump to dump the db. If you don't, install and mount the hard drive in the new machine. Install MySQL on the new machine, and set it up with passwords, etc. Stop the daemon, and move the db file in the old drive's /var/lib/mysql (assuming you didn't change the location from the default) to the new drive's /var/lib/mysql. You will need to be root, and then change the file ownership to mysql: chown mysql.mysql mydbfile Start MySQL again. Access the file via the MySQL console, and adjust db permissions as appropriate. I think this should cover it, unless I've omitted something :-) -- Pob hwyl / Best wishes Kevin Donnelly www.kyfieithu.co.uk - Meddalwedd Rhydd yn Gymraeg www.cymrux.org.uk - Linux Cymraeg ar un CD!
On Tue, 2005-06-07 at 00:43 +0800, Ronald Wiplinger wrote:
My machine with the database is broken. I need to transfer the data to another machine.
How do I do that?
There is The Right Way, and then, there is, of course, the quick and dirty way. The quick and dirty way has never failed for me, but use it at your own risk: on old server or old disc: cd /var/lib tar cfj mysqldb.tar.bz2 mysql copy mysqldb.tar.bz2 to new server on new server: cd /var/lib tar xfj mysqldb.tar.bz2 -- Kind Regards Hans du Plooy SagacIT (Pty) Ltd hansdp at sagacit dot com
participants (4)
-
Hans du Plooy
-
Ken Schneider
-
Kevin Donnelly
-
Ronald Wiplinger