hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : VPS Hosting : Path For MySQL Databases?
Reply

VPS Hosting Virtual private server discussion and vps hosting solutions. Review VPS hosting providers and offer advice on virtual web hosting solutions. If your service is unavailable, please click here.
Forum Jump

Path For MySQL Databases?

Reply Post New Thread In VPS Hosting Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 10-25-2009, 12:53 PM
isi123 isi123 is offline
Junior Guru Wannabe
 
Join Date: Jun 2008
Posts: 38

Path For MySQL Databases?


Hi guys,

Just wanted to ask, which folder are the MySQL databases held in for Cpanel? Running CentOS 5 VPS.

Thanks!

Reply With Quote


Sponsored Links
  #2  
Old 10-25-2009, 01:14 PM
PCS-Chris PCS-Chris is offline
Premium Member
 
Join Date: Dec 2005
Location: Berkshire, UK
Posts: 2,848
That would be /var/lib/mysql

__________________
System Administrator
» Follow me on twitter: Here

Reply With Quote
  #3  
Old 10-25-2009, 01:29 PM
isi123 isi123 is offline
Junior Guru Wannabe
 
Join Date: Jun 2008
Posts: 38
Quote:
Originally Posted by PCS-Chris View Post
That would be /var/lib/mysql
Great! Thank you sir.

One thing, the databases are in single folders, and not SQL's. IS there a way i can convert them to SQL's?

I had a corrupted backup and have to manually restore the databases.

If i can;t convert them to SQL's then how am i to restore them to Cpanel?

Thanks so much!

Reply With Quote
Sponsored Links
  #4  
Old 10-25-2009, 01:32 PM
PCS-Chris PCS-Chris is offline
Premium Member
 
Join Date: Dec 2005
Location: Berkshire, UK
Posts: 2,848
Sorry but I dont quite follow.

If you want .sql files (SQL Dumps) you need to use the mysqldump utility which will backup a database currently running on your machine.

If you have a backup of the raw .mdf files, then you need to create the database, stop the MySQL service, copy your back into the relavent directory and overwrite the existing files. Then start MySQL and hold your breath... it doesnt always work this way. It's much preferrable to use SQL dumps.

__________________
System Administrator
» Follow me on twitter: Here

Reply With Quote
  #5  
Old 10-25-2009, 01:46 PM
isi123 isi123 is offline
Junior Guru Wannabe
 
Join Date: Jun 2008
Posts: 38
Quote:
Originally Posted by PCS-Chris View Post
Sorry but I dont quite follow.

If you want .sql files (SQL Dumps) you need to use the mysqldump utility which will backup a database currently running on your machine.

If you have a backup of the raw .mdf files, then you need to create the database, stop the MySQL service, copy your back into the relavent directory and overwrite the existing files. Then start MySQL and hold your breath... it doesnt always work this way. It's much preferrable to use SQL dumps.
Sorry for being unclear, but your understanding was correct. I want to change the raw mdf files to a SQL file.

I did think of the second way, but haven't tried it yet. But may try it now i have you also mentioning it. But before that, i would like to do the first idea. What sort of utility can i use to backup the raw file directory to an SQL?

Thanks!

Reply With Quote
  #6  
Old 10-25-2009, 05:20 PM
cscarlet cscarlet is offline
Junior Guru
 
Join Date: Aug 2009
Location: England
Posts: 196
Can you confirm if it is Microsoft SQL or MYSQL?
mdf's are as far as I am aware is what is used by Microsoft's SQL product.

__________________
Christopher Smith
My Cheap cPanel Hosting Reviews

Reply With Quote
  #7  
Old 10-25-2009, 06:32 PM
gplhost gplhost is offline
Web Hosting Master
 
Join Date: Aug 2004
Location: Shanghai
Posts: 1,440
Quote:
Originally Posted by isi123 View Post
I did think of the second way, but haven't tried it yet. But may try it now i have you also mentioning it. But before that, i would like to do the first idea. What sort of utility can i use to backup the raw file directory to an SQL?

Thanks!
I would not advise anyone to use a copy of any files in /var/lib/mysql. First, there's absolutely nothing that can guarantee that this type of file wont change, or that just copying them over will be enough, you are just betting on it. Second, it's quite known (and I experienced it) that there are issues between 32 and 64 bits version of MySQL with them. So just use mysqldump, it's a way safer.

Thomas

__________________
GPLHost:>_ open source hosting worldwide (I'm founder, CEO & official Debian Developer)
Servers & our leading control panel and our Xen VPS hosting, which are already included in Debian and Ubuntu
Available in: Kuala Lumpur, Singapore, Sydney, Seattle, Atlanta, Paris, London, Barcelona, Zurich, Israel

Reply With Quote
  #8  
Old 10-26-2009, 12:28 AM
NeilAgg NeilAgg is offline
Web Hosting Guru
 
Join Date: Sep 2006
Location: Dallas, TX
Posts: 314
Looking in the /var/lib/mysql folder for one of my databases, it has a .frm, .MYD, and .MYI file for each table.

I wonder if you could:
1. Go to a new VPS
2. Create an empty database with the name of your database
3. Create a dummy table with the same same as a table you already have, it can be simple with even one column.
4. Stop the mysqld process
5. Copy the .frm, .MYD, and .MYI files from your other VPS over the files created on it.
6. Start the mysqld process.

I would think that would work, but I would definitley test it first.

<<signature to be setup in your profile>>


Last edited by anon-e-mouse; 10-26-2009 at 02:38 AM.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to restore mysql databases from /var/lib/mysql/user_database/ files only? bjdea1 Hosting Security and Technology 2 02-11-2008 05:44 AM
mysql path for cpanel e-view Hosting Software and Control Panels 1 09-19-2004 10:24 PM
mysql path for cpanel e-view Hosting Security and Technology 2 09-19-2004 01:33 PM
Path to users mysql Salvatore Dedicated Server 8 03-02-2004 10:41 PM
MySQL Path Dedicated Hosting Security and Technology 3 11-07-2001 06:11 PM

Related posts from TheWhir.com
Title Type Date Posted
Rackspace Offers New Cloud Database Service Free Until September Web Hosting News 2012-08-09 14:33:06
Cloud Security Firm Gazzang Joins AWS Service Provider Program Web Hosting News 2012-01-05 22:02:32
Web Host Rackspace Launches Private Beta for MySQL Cloud Database Web Hosting News 2011-12-01 21:09:51
Web Host FireHost Partners with Cloud Security Firm Gazzang for Data Encryption Web Hosting News 2011-08-16 20:33:43
Gazzang Data Encrytion Solution Adds Support for CloudLinux Platform Web Hosting News 2011-06-30 18:54:10


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?