Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


creating another mysql instance and restoring DB (R1soft)
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

creating another mysql instance and restoring DB (R1soft)

  1. Restore the raw DB files from the recovery point:

ib_logfile0
ib_logfile1
ibdata1
/var/lib/mysql/mysql
/var/lib/mysql/_dbname

The log files, ibdata and mysql tables must always be restored in addition to the actual user database(s).

Important: Restore to an ALTERNATE location (do NOT overwrite existing location). Use e.g. /var/lib/mysql_tmp (ensure there is enough space). Folder needs to have ownership by mysql:mysql.

  1. Start a temporary MySQL instance

Replace the path with where the data was restored.

mysqld_safe --socket=/var/lib/mysql_tmp/mysql.sock --port=3307 --datadir=/var/lib/mysql_tmp

You now have a separate MySQL server running with the data from the restored backup. It is now posssible to connect to the instance using port 3307 or the socket path.

  1. Generate DB dump

To create a database dump from the temp instance, use this command (replace path to socket with actual path):

mysqldump --socket=/var/lib/mysql_tmp/mysql.sock dbname > dbname.sql

  1. Cleanup

Stop the temp instance by killing the process and delete the restored files.

Sign In or Register to comment.