简体   繁体   中英

How to backup MySQL in rescue mode?

I have a Rackspace VPS running CentOS that I can only access in Read Only rescue mode. How can I backup/restore MySQL using SSH and FTP with no access to mysql command line tools?

The reason for this is that the image used to build the server has an issue with Nova so Rackspace are unable to build from it. What I need to do is transfer all files onto a clean new machine.

I can access all files without issue, but I would also like to recover any MySQL database that were on the machine. However, MySQL will not run in the rescue mode Rackspace offer and I can't use these tools to make any kind of dump - I have SSH and FTP only. Can anyone hint as to how I can rescue/transfer my MySQL databases to the new machine?

Setup a new VPS with an identical version of mysql and transfer (scp/rsync/sftp) the raw database files in /var/lib/mysql and the mysql conf file (typically /etc/my.cnf) to the new server. Make sure the permissions of these files don't change on the new server. This wouldn't work without a third party utility (Percona Xtrabackup for example) if mysqld was running but since you cannot run mysqld in r/o mode anyways this is your best bet.

Example path is miliardowo My old server was debian. New one is Ubuntu 14.04 LTS

  1. Copy file from /var/lib/mysql/miliardowo to your server

  2. Add permission in /var/lib/mysql/

    chmod 700 miliardowo/

    chmod 660 miliardowo/*

    chmod gs miliardowo/

    chmod gs miliardowo/*

    chmod us miliardowo/

    chmod us miliardowo/*

    chown mysql:mysql miliardowo/

    chown mysql:mysql miliardowo/*

  3. updatedb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM