LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-04-2005, 04:32 PM   #1
matrixcubed
LQ Newbie
 
Registered: May 2004
Location: Gatineau, QC
Distribution: Ubuntu 6.10
Posts: 25

Rep: Reputation: 15
MySQL Migration Help


Hello all,

Here is my situation:

I had recently "backed up" some data in a MySQL database directory, before reinstalling the OS.

Currently, I am trying to find a way to restore this database information, as I am unable to view it simply by copying the corresponding directories into my server's MySQL data directory.

Hindsight dictates that I completely did not backup the data in an appropriate fashion (e.g. exporting into .sql files then later reimporting), but I do possess the entire data set, so I am hoping there is a way to restore this properly.

If anyone can assist or suggest a way of reimporting this data (or converting it to a usable format), it'd be greatly appreciated!

Thanks
 
Old 06-05-2005, 11:26 AM   #2
zeos
Member
 
Registered: Aug 2003
Posts: 150

Rep: Reputation: 15
If you simply backed up the files in /var/lib/mysql/databasename/ you can restore them fairly easily. Connect to mysql and create a new database..
Code:
CREATE DATABASE databasename;
Stop mysql...
Code:
mysqladmin shutdown
You'll find a newly created directory within /var/lib/mysql with the databasename you created. Copy your files from the original database into that directory and chown them to the user mysql runs as (generally mysql.mysql) -
Code:
chown mysql.mysql /var/lib/mysql/databasename/*
Restart mysql
Code:
/etc/init.d/mysql start
You should now be able to connect to the database you created (use databasename) and see the tables and data as root as well as grant access to any users etc that you need to access the data.

Last edited by zeos; 06-05-2005 at 11:29 AM.
 
Old 06-05-2005, 12:41 PM   #3
matrixcubed
LQ Newbie
 
Registered: May 2004
Location: Gatineau, QC
Distribution: Ubuntu 6.10
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks for your response.

I have tried this, and apparently the data is not read by the forum script I am using (punBB). The data appears in the phpadmin tool I use from the web, which tells me the data is there. Think I'll have to head on over to the punBB forums and see if they have a fix.

Ideally what I want to do is convert the existing data to .sql files, so I may import them into appropriate tables... but I don't even know if this will 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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-07-2008 11:48 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:57 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration