LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-27-2013, 02:55 PM   #1
Rupadhya
Member
 
Registered: Sep 2012
Location: Hoffman Estates, IL
Distribution: Fedora 20
Posts: 167

Rep: Reputation: Disabled
Query against MySQL to tell where the files for the tables are.


Hello all,

I used to know a query in Oracle that did this, but I would like one in MySQL.

What I would like is this. I would like a query that told me the location and the names of the files where actual data in a mysql db stored on a linux server.

My plan is this. Find out where the data is stored, bring down the MySQLd and then back up the data files. In case of catastophic failure, I hope to be able to restore the data.

Regards,

Raj Upadhyaya
 
Old 04-27-2013, 03:04 PM   #2
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,323
Blog Entries: 5

Rep: Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785
no need to interrogate mysql with this task...
Code:
grep -iw datadir /etc/my.cnf
 
1 members found this post helpful.
Old 04-27-2013, 07:05 PM   #3
Rupadhya
Member
 
Registered: Sep 2012
Location: Hoffman Estates, IL
Distribution: Fedora 20
Posts: 167

Original Poster
Rep: Reputation: Disabled
Cool! Should I back up everything in this directory? Is there a way I can keep the storage some where else (I think it is in the root file system for my server, which is pretty small.)

- Raj Upadhyaya
 
Old 04-28-2013, 08:14 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Use the mysqldump cmd; it'll give you a consistent backup without having to shutdown MySQL, and you can choose exactly what you want backed-up.
http://www.day32.com/MySQL/
https://dev.mysql.com/doc/refman/5.1...-recovery.html
 
  


Reply

Tags
linux, mysql, storage, tablespace


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
[SOLVED] MySQL: Comparing values in diff tables SQL Query and BASH watice Programming 4 12-24-2012 12:56 PM
mysql query two tables please Help Mike1569 Linux - Server 2 07-09-2009 12:31 AM
mysql tuning problem: show query and fragmented tables! gavin2u Linux - Server 1 02-12-2009 06:32 PM
MySQL - Query and compare 2 tables rookiepaul Programming 4 05-12-2008 09:05 AM
SQL query, comparing tables ngomong Programming 3 07-07-2002 07:44 PM


All times are GMT -5. The time now is 09:29 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 Google+: linuxquestions
Open Source Consulting | Domain Registration