2

I need to restore from folder backup my mysql databases.
I have a complete /var/lib/mysql folder backed up with all the files.
I have a fresh install of mysql. I copied back from the backup the database folders and all of the ibdata and ib_logfile files. I set up the permissions for the new files with chown -R mysql:mysql. The server starts without problems but cant "see" the databases copied from backup if I list the databases from mysql prompt.
Any idea how to get mysql see the backup databases?

2
  • The original server went down, and i have just the /var/lib/mysql folder backup...
    – c001os
    Jul 19, 2020 at 12:29
  • Ok! Answer is from memory so be careful :)
    – Rinzwind
    Jul 19, 2020 at 12:31

1 Answer 1

1

I copied back from the backup the databse folders and all of the ibdata and ib_logfile files.

With cp? If so I was told to use rsync for this.

Stop mysql with sudo service stop mysql

From an old version of /var/lib/mysql/

sudo rsync -av /{backup_dir}/ /var/lib/mysql/
sudo chown -R mysql: /var/lib/mysql

Start mysql with sudo service start mysql

Check for errors before proceeding (onscreen and /var/log/mysql)

And set your system up to create automatic dumps with mysqldump and have those backups stored on another partition or even another system.

2
  • Thats not working: 2020-07-19T12:36:13.200089Z 1 [ERROR] [MY-013171] [InnoDB] Cannot boot server version 80020 on data directory built by version 80021. Downgrade is not supported mysqld: Can't open file: 'mysql.ibd' (errno: 0 - ) 2020-07-19T12:36:18.212873Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2020-07-19T12:36:18.213249Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2020-07-19T12:36:18.213511Z 0 [ERROR] [MY-010119] [Server] Aborting
    – c001os
    Jul 19, 2020 at 12:37
  • You need to use the SAME MYSQL. Not an older or newer version.
    – Rinzwind
    Jul 19, 2020 at 12:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .