LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-19-2013, 07:42 AM   #1
kox444
Member
 
Registered: Aug 2012
Posts: 112

Rep: Reputation: Disabled
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.
 
Old 01-19-2013, 07:52 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,790
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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.
 
Old 01-19-2013, 08:31 AM   #3
kox444
Member
 
Registered: Aug 2012
Posts: 112

Original Poster
Rep: Reputation: Disabled
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

Last edited by kox444; 01-19-2013 at 11:16 AM.
 
Old 01-20-2013, 07:40 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,790
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question List: Core, Extra and Testing, datebase and Powerpill vs Pacman culaterout Arch 2 01-25-2010 07:45 AM
Connection to MS SQL Datebase thomas2004ch Linux - Newbie 4 08-23-2009 01:15 PM
Uninstall Mysql After mysql is corrupted KapilSatav Linux - Server 2 08-18-2009 02:01 AM
mysql is in /var/lib/mysql/[database]....how to transfer to my username? RMLinux Linux - Newbie 14 11-30-2008 10:35 PM
Corrupted MySQL Tables cli_man Linux - Software 4 10-22-2003 06:49 AM


All times are GMT -5. The time now is 07:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration