LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to copy mysql db's from hardisk to new server? (https://www.linuxquestions.org/questions/linux-software-2/how-to-copy-mysql-dbs-from-hardisk-to-new-server-225350/)

nbier 09-01-2004 02:18 PM

How to copy mysql db's from hardisk to new server?
 
My server was cracked and left in a non bootable state. I've built a new server w/ a fresh install and have mounted the old hard disk so that I can recover data.

I'm trying to get the old databases (/var/lib/mysql) and somehow move or import them into the new mysql server. Any of the advice that I've found so far has not worked because it all requires the old server to be running (hotcopy, mysqldump, etc, etc).


Does anyone have any suggestions for moving the databases as they exist in the old filesystem and importing them into the new server?

Thanks!

OS: SuSE 9.0
Mysql: 4.0.15-Max

nbier 09-01-2004 02:34 PM

OK, managed to solve it. In case anyone else runs into it, simply shutdown mysql and delete all directories in /var/lib/mysql. There should only be two: mysql and test. Then copy over all of the directories from the same location on the old harddrive--make sure that you retain earlier permissions (cp -rp). Restart mysql and run some queryies to see if you're back up and running.

Tinkster 09-01-2004 02:36 PM

I would have thought that mysqldump and restore would
be a cleaner way ;)


Cheers,
Tink

nbier 09-01-2004 02:38 PM

Doesn't that require?
 
I thought mysqldump required a running server? I'll confess to not RingTFM, I just assumed that the old server would have still needed to be running for mysqldump to work.

Tinkster 09-01-2004 03:24 PM

Nope, you're absolutely right. I was assuming that
there's an easy way of booting the box off a recovery
CD ...


Cheers,
Tink


All times are GMT -5. The time now is 07:22 PM.