LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
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
 
LinkBack Search this Thread
Old 11-14-2009, 08:21 PM   #1
onthefritz
Member
 
Registered: Dec 2005
Location: Colorado
Distribution: Ubuntu, RHEL, openSUSE
Posts: 105

Rep: Reputation: 19
mysql server died


Ok, I had a server that was running mysql. It died. I can get into the HD for the old server, but I need to pull the mysql DBs off of it. I don't know how to do this. I found the folder that I believe contains the DBs, but I don't know how to pull them in. (/var/lib/mysql/ )

thank you in advance,

Fritz
 
Old 11-14-2009, 08:47 PM   #2
Robhogg
Member
 
Registered: Sep 2004
Location: solihull.w-mids.uk
Distribution: Debian 5.0, CentOs, Solaris 8-10
Posts: 573

Rep: Reputation: 58
It's been a while since I last did it, but I think the drill went like this:
  • Create a database in MySQL on the new machine for each database you want to recover (it should have the same name as the database on the original server). At its most basic, this just involves (e.g.) "create database mydb;"
  • Stop mysql: sudo /etc/init.d/mysql stop
  • /var/lib/mysql on both machines should now contain a directory with the same name as the database. These directories will contain (at least) structure, data and index files for each table. Replace the directory on the new machine with the directory on the old. It's probably better to leave the "mysql" system database folder alone, though.
  • Check permissions on the folders and the files they contain. If the mysql user/group on the new server have a different uid and gid, you will to chown the files before they can be used.
  • Restart mysql
  • Create appropriate permissions on the databases.
  • Back up the databases using mysqldump or similar
I can't remember having too much trouble getting it to work.

Last edited by Robhogg; 11-14-2009 at 08:48 PM.
 
Old 11-14-2009, 10:18 PM   #3
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 71

Rep: Reputation: 19
onthefrit,

If your database only had its tables using the MyISAM storage engine, then you can simply copy over the /var/lib/mysql/YOURDATABASE to the new server. As long as the permissions are set properly, it should be accessible within your new MySQL server.
 
Old 11-16-2009, 09:38 AM   #4
onthefritz
Member
 
Registered: Dec 2005
Location: Colorado
Distribution: Ubuntu, RHEL, openSUSE
Posts: 105

Original Poster
Rep: Reputation: 19
Well, it turned out to be the permissions. I had copied the DBs over before but I didn't change the file permissions. Thanks for the input!

OTF
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning; x server died on me sharky Ubuntu 3 08-28-2008 01:14 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
X server.. died somehow student04 Mandriva 16 09-01-2004 02:51 PM


All times are GMT -5. The time now is 08:25 PM.

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
Open Source Consulting | Domain Registration