Answer the question
In order to leave comments, you need to log in
Is it possible to just copy MySql files?
Good afternoon. MySql does not work on the server. Dumping with mysqldump is not possible. Is it possible to just pull text files from /var/lib/mysql/mydatabase with a chance that they will work (well, let's say, on a local computer)?
Answer the question
In order to leave comments, you need to log in
Text? No, text will not work. /var/lib/mysql/ binaries. A bit of text there, of course, is also there, but the data is in binary.
Make a copy of the directory (attention to access rights and file owners, this is also important and they must be saved) datadir. It looks like you have /var/lib/mysql/
Move to a machine with the same version of mysql, preferably exactly the same version, but within minor versions. Along the way, make another copy of the data.
Of course, mysql must be stopped on the new machine at the time of copying.
Start mysql, read logs, fix errors.
Further on the circumstances. If you are wound up, then check your data, if not, read further logs and Google.
Innodb will recover to the last committed transaction on success. myisam - even in the best case, how lucky. Fault tolerance is not about him.
Can. It's best to use the entire /var/lib/mysql - and deploy it somewhere else. True, all rights, logins and passwords will be dragged away, so if you do not know the password of the administrator of this installation, it is better to drag the databases in parts - one directory is one database if it is in the MyISAM format. If InnoDB - then you are less fortunate - these are several large files lying in the root / var / lib / mysql. If you know the password, well, or you are not afraid to break it, you can copy the whole thing.
> /var/lib/mysql/mydatabase
No.
You can only copy the entire /var/lib/mysql (assuming mysql is stopped).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question