LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How do I transfer mysql datebase from corrupted OS to new OS (https://www.linuxquestions.org/questions/linux-server-73/how-do-i-transfer-mysql-datebase-from-corrupted-os-to-new-os-4175446318/)

kox444 01-19-2013 07:42 AM

How do I transfer mysql datebase from corrupted OS to new OS
 
First off I'm not running any server. I just like to play with php for fun. So the datebase is not that important. I bought a new hardware, but kept HDD. I must have chosen to keep only drivers needed for this hardware to run during installation, so obviously now the old system is useless (Debian Squeeze). I have already reinstalled Debian Wheezy and I think I'm gonna use it as my main system. So I'm not able to run my old system, but I have accesss to its partition.
Now I'd like to know where is the location of files holding the datebase and how does one transfer the datebase to new system having only access to the old os' partition.

Hangdog42 01-19-2013 07:52 AM

I've usually used mysqldump to do this sort of task. No need to mount the old drive on the new system, you just need to transfer the file from mysqldump.

kox444 01-19-2013 08:31 AM

I didn't buy new drive. To mount old os partition I just need to click mount and I can't run old OS so how do I use this tool?

I've found the directory. But I have another problem I want my datebase to be at home (partition). I changed db location in /etc/mysql/my.conf and applied identical permissions as in original directory but mysql fails to start.

Edit: When I apply permission for my new db datadir, it applies it just for the directory itself, how can I apply it to subdirectories within it? Apply to enclosed files doesn't work.

Edit:2 I did it but phpmyadmin doesn't seem to work. It wasn't found on the server. Maybe I should reconfigure it.
I got it too. If anybody has a problem with phpmyadmin being not found then make link between config files: # ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf

Hangdog42 01-20-2013 07:40 AM

Quote:

I didn't buy new drive. To mount old os partition I just need to click mount and I can't run old OS so how do I use this tool?
Yeah, if you can't boot the old OS/database, then mysqldump might not help the way I thought.
Quote:

I've found the directory. But I have another problem I want my datebase to be at home (partition). I changed db location in /etc/mysql/my.conf and applied identical permissions as in original directory but mysql fails to start.
I think you need to do this in a couple of steps. The first one is to get the old database files mounted by whatever means necessary, then use mysqldump to create a file of the database. The second step would be to then configure mysql the way you want to now, and then use the mysqldump file to re-create the old database in the new location.

As for mysql failing to start, you need to look at the mysql log files. Those are usually pretty verbose and should give you a pretty good idea of what is going on.

Quote:

Edit: When I apply permission for my new db datadir, it applies it just for the directory itself, how can I apply it to subdirectories within it? Apply to enclosed files doesn't work.
How are you applying the new permissions now? Some details would help.


Quote:

Edit:2 I did it but phpmyadmin doesn't seem to work. It wasn't found on the server. Maybe I should reconfigure it.
I got it too. If anybody has a problem with phpmyadmin being not found then make link between config files: # ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
Sounds kinda kludgy to me. Phpmyadmin is generally pretty self-contained and shouldn't need linking all over the place in order to work.


All times are GMT -5. The time now is 09:35 PM.