Restoring MySQL Backup

Run the mysqlsh shell utility at the CLI prompt.

  1. Type mysqlsh --no-defaults command at the CLI prompt, it opens the JS prompt. Then run the below commands one by one in the prompt:
    1. Connect to a MySQL instance by typing the below command:
      \connect root@localhost:3306
    2. When prompted for a password, paste the password as copied from /root/.my.cnf in Copy Password.
    3. Prepare for restore by typing the below command one by one:
      \sql set GLOBAL local_infile=1;
      
      \sql ALTER INSTANCE DISABLE INNODB REDO_LOG;
      
      \sql drop database <DATABASE>;

      For Mediation Engine, use DATABASE = vsp

      For Mediation Engine Connector, use DATABASE = pldmaster

      For Fraud Monitor, use DATABASE = fdp

    4. Run the below command to begin restore:
      util.loadDump("/<PATH_TO_MYSQL_BACKUP_DIRECTORY>/<DATABASE>.dump", {threads: 88, ignoreVersion: true})

      Example For Mediation Engine:

       util.loadDump("/root/mysqlBackup/vsp.dump", {threads: 88,ignoreVersion:true})

      Once the restore is successful, you will see a message similar to the below sample:

      Target is MySQL 8.0.28-commercial. Dump was produced from MySQL 5.7.35-enterprise-commercial-advanced-log
      WARNING: Destination MySQL version is newer than the one where the dump was created. Loading dumps from different major MySQL versions is not fully supported and may not work. The 'ignoreVersion' option is enabled, so loading anyway.
      NOTE: Load progress file detected. Load will be resumed from where it was left, assuming no external updates were made.
      You may enable the 'resetProgress' option to discard progress for this MySQL instance and force it to be completely reloaded.
      Scanning metadata - done
      Executing common preamble SQL
      Executing DDL - done
      Executing view DDL - done
      Starting data load
      88 thds loading \ 100% (260.70 MB / 260.70 MB), 8.44 MB/s, 544 / 63 tables and partitions done
      Recreating indexes - done
      Executing common postamble SQL
      NOTE: The redo log is currently disabled, which causes MySQL to not be crash safe! Do not forget to enable it again before putting this instance in production.
      7796 chunks (9.97M rows, 260.70 MB) for 63 tables in 1 schemas were loaded in 1 min 40 sec (avg throughput 7.83 MB/s)
      0 warnings were reported during the load.
    5. Enable REDO_LOG by typing the below command:
      \sql ALTER INSTANCE ENABLE INNODB REDO_LOG;
    6. Exit from mysql-shell by typing the below command:
      \quit