
10-25-2009, 12:53 PM
|
|
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!
|

10-25-2009, 01:14 PM
|
|
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
|

10-25-2009, 01:29 PM
|
|
Junior Guru Wannabe
|
|
Join Date: Jun 2008
Posts: 38
|
|
Quote:
Originally Posted by PCS-Chris
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!
|

10-25-2009, 01:32 PM
|
|
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
|

10-25-2009, 01:46 PM
|
|
Junior Guru Wannabe
|
|
Join Date: Jun 2008
Posts: 38
|
|
Quote:
Originally Posted by PCS-Chris
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!
|

10-25-2009, 05:20 PM
|
|
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.
|

10-25-2009, 06:32 PM
|
|
Web Hosting Master
|
|
Join Date: Aug 2004
Location: Shanghai
Posts: 1,440
|
|
Quote:
Originally Posted by isi123
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
|

10-26-2009, 12:28 AM
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| 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
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|