[Gllug] Extract the data from a MySQL database's *files*?

Sean Burlington sean at practicalweb.co.uk
Thu Apr 1 14:36:30 UTC 2010

if they are MyISAM tables it should be pretty easy (*.MYI and *.frm)

Just create an empty database in you new system then shut down mysql

copy all your files from the old  /var/lib/mysql/$database to the new one

start mysql again

your database should have your tables in it.

If they are innodb tables I don't think this works.

On 1 April 2010 15:26, Richard Jones <rich at annexia.org> wrote:
> On Thu, Apr 01, 2010 at 02:39:55PM +0100, Richard Huxton wrote:
>> On 01/04/10 14:29, Richard Jones wrote:
>> >
>> > I've got a friend who has a VM image.  This image used to be a MySQL
>> > database instance, but for various reasons we cannot boot it any more.
>> >
>> > However, the raw MySQL database files are still on there.
>> >
>> > Can we extract the data somehow?  Can we tell another MySQL instance
>> > to look at these files?
>> If you have actual files, then yes. Can you mount the image's virtual
>> disks OK?
> Yup, the /var filesystem is fine, it just cannot be booted because
> there is no operating system.
> So I have the /var/... mysql files, including a Wordpress database,
> and I just want to extract that to another MySQL instance.
> Rich.
> --
> Richard Jones
> Red Hat
> --
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug


Sean Burlington

Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list