Version 3.12.1

4.3.1. MySQL logical

Use standard tools for logical dump restoration.

More information you can find on the official documentation pages [mysql 8.0] [mysql 5.7]

Feel free to use a version of mysql, compatible with your database server version.

In general terms, the recovery order will be as follows: create the database to restore, uncompress (if the backup was compressed), and restore the backup.

Step-by-step instruction:

1. Log into mysql server:

$ mysql -u root -p
- `-u` - user for loging to datase;
- `-p` - shell will ask you to prompt for a password before connecting to a database;

2. Create database if it doesn't exist

mysql> CREATE DATABASE production;

3. Exit to OS shell

4. Restore DB dump from OS shell:

    # syntax
    # mysql -u <username> -p <database_name> < /path/to/dump.sql
    # example
    $ gunzip < /var/nxs-backup/db/mysql/production/daily/mysql_production_2022-08-08_10-12.sql.gz | mysql -u root -p production