Running the mysqlsh Shell Utility

Run the mysqlsh shell utility at the CLI prompt.

  1. Type mysqlsh --no-defaults command on CLI. This opens the JS prompt.
  2. Run the following commands in sequence at the CLI prompt:
  3. Connect to a MySQL instance by typing the below command:
    \connect root@localhost:3306
  4. When prompted for a password, paste the password copied from /root/.my.cnf inCopy Password.
  5. 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

  6. Run the below command to begin the restore process:
    util.loadDump("/<PATH_TO_MYSQL_BACKUP_DIRECTORY>/<DATABASE>.dump", {threads: 88, ignoreVersion: true})
    For example, for ME:
    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.
  7. Enable REDO_LOG by typing the below command:
    \sql ALTER INSTANCE ENABLE INNODB REDO_LOG;
  8. Exit from mysql-shell by typing the below command:
    \quit