469,167 Members | 1,399 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,167 developers. It's quick & easy.

recover a database just from the filesystem.

I've got a disk that had the data files for my mysql server on it.
From these files can I rebuild the database? I didn't do backups or
anything like that, but I have the whole file system. What I was
looking to do was reinstall mysql and then somehow import those files
to recreate the database, is this possible?

Thanks,

Fenton
Jul 20 '05 #1
4 3962
anonymous wrote:
I've got a disk that had the data files for my mysql server on it.
From these files can I rebuild the database? I didn't do backups or
anything like that, but I have the whole file system. What I was
looking to do was reinstall mysql and then somehow import those files
to recreate the database, is this possible?

Thanks,

Fenton


You can just copy the files into the new data store folder then make
sure you run a repair on all tables. Also remember to chown and chgrp
the files and folders to mysql (chown -R mysql.mysql *) for *nix systems.

I have done this many times as a quick way of transfering large amounts
of data between servers.

Hope this helps

Peter.
Jul 20 '05 #2
anonymous wrote:
I've got a disk that had the data files for my mysql server on it.
From these files can I rebuild the database? I didn't do backups or
anything like that, but I have the whole file system. What I was
looking to do was reinstall mysql and then somehow import those files
to recreate the database, is this possible?

Thanks,

Fenton

You can just copy the files into the new data store folder then make
sure you run a repair on all tables. Also remember to chown and chgrp
the files and folders to mysql (chown -R mysql.mysql *) for *nix systems.

I have done this many times as a quick way of transfering large amounts
of data between servers.

Hope this helps

Peter.
Jul 20 '05 #3
"Peter King" wrote:
anonymous wrote:
Iíve got a disk that had the data files for my mysql server on it.
From these files can I rebuild the database? I didnít do

backups or
anything like that, but I have the whole file system. What I was
looking to do was reinstall mysql and then somehow import those

files
to recreate the database, is this possible?

Thanks,

Fenton

You can just copy the files into the new data store folder then

make sure you run a repair on all tables. Also remember to chown and chgrp the files and folders to mysql (chown -R mysql.mysql *) for *nix
systems.

I have done this many times as a quick way of transfering large
amounts
of data between servers.

Hope this helps

Peter.


Peterís solution works in your case, since no other backups exist.

For others reading this post and wanting to copy the file system for
regular backups, I have heard that you cannot recover the files 100%
of the times, so this approach is not to be relied on for regular
backups. Comments?

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/mySQL-recove...ict135682.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=454900
Jul 20 '05 #4
"anonymous" <fe************@yahoo.com> skrev i en meddelelse
news:47**************************@posting.google.c om...
I've got a disk that had the data files for my mysql server on it.
From these files can I rebuild the database? I didn't do backups or
anything like that, but I have the whole file system. What I was
looking to do was reinstall mysql and then somehow import those files
to recreate the database, is this possible?


Assume the architecture is the same (eg you didn't upgrade from windows to
*nix or to another cpu family (eg i386 to alpha)), and the mysql version is
the same, you simply install mysql, stop it, drop the datafiles in the data
directory, start mysql, and it is running the backup'ed databases.

Leif

PS: Even if you changed os or cpu family, the backups might work anyway,
I'm, sure which platforms are binary compatible.
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Snake Djip | last post: by
reply views Thread by sunildutt | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.