← Back to team overview

maria-discuss team mailing list archive

Re: [EXTERNAL] Re: Copying database files

 

> >>> I'm using MariaDB 10.2.13 on Windows 7.  All tables are using the Aria
> >>> engine.
> >>>
> >>> I am trying to initialise a slave database by copying the files between
> >>> PCs, but when I try and use the copied files I get the error
> >>>
> >>> Table is from another system and must be zerofilled or repaired to be
> >>> usable on this system
> >>>
> >>> Repairing the tables fixes this, but I'd rather not have to so that.
> >>>
> >>> I have tried various things suggested to stop this, but nothing seems to
> >>> help. On the source server I have run aria_chk -zerofill on all the
> >>> tables. Before copying the tables I run FLUSH TABLES <table list> FOR
> >>> EXPORT, but I still get the error.
> >> jesus don't copy tbale files around while the server is running
> >>
> 
> no idea why you repsond off-list
> 
I forgot to use reply all. Most lists, just reply works. Sorry

> > Does that mean this is not valid then...
> 
> did you read and understand it
> 

Yes I read and understood it. I've been doing this for the last 10 years with MySQL without any problem. I was assuming I could do the same with MariaDB.

> how make you sure "The server is not accessing the tables during the
> copy process"
> 
> "The advantage of FLUSH TABLES table_name FOR EXPORT is that the table
> is read locked until UNLOCK TABLES is executed" is not really true
> because that's only valid for the running connection
> 

Surely not. If you've locked a table for read only nothing should be able to write to it from any connection otherwise what's the point of a multi-threaded server? Tests suggest otherwise.

> "Warning: If you do the above live copy, you are doing this on your own
> risk" should be clear
> 
> in short: nobody right in his mind copies database tables hot
> 

The code doing this stops everything talking to the database (Yes, I know there could be someone fiddling remotely in a shell, but this is very unlikely). Even tables which are never written to cause this error

So if I'm careful, is there a way to make this work without stopping the server?

Thanks for the help

Regards

Andy Ling


Follow ups

References