*If you reinstall MySQL and execute following process, 
 make sure that followings have been already deleted correctly
 after uninstalling the old MySQL.
 - Directory where MySQL main unit is installed.
   (Windows default: C:\Program Files\MySQL)
 - Directory where MySQL configuration files are deployed.
   (Windows default: C:\ProgramData\MySQL)

1. Installation of Database

   Please check MySQL version 5.7 or later.
   Please setup below.
    >Choose "Server only" for Setup Type.
    >Choose "Dedicated Machine" for ConfigType at Type and Networking.

2. Create database

   Execute below command by root user at mysql client.
     create database mtdb character set utf8mb4 collate utf8mb4_bin;

    On collate clause,
     In the case that you want to distinguish between a capital letter and a small letter : utf8mb4_bin
     In other case : utf8mb4_general_ci

3. Create users

   Execute below command by root user at mysql client.

   (1) Create user for application

        create user 'mtpusr'@'%' identified by 'mtpusr';

   (2) Give the authority to the application user

        grant select,insert,create,create temporary tables,update,delete,execute on mtdb.* to 'mtpusr'@'%';

   (3) Create admin user

        create user 'mtpadm'@'%' identified by 'mtpadm';

   (4) Give the authority to the admin user

        grant all on mtdb.* to 'mtpadm'@'%' IDENTIFIED BY 'mtpadm' WITH GRANT OPTION;
          *For MySQL8.0 or later, execute as follows.
           grant all on mtdb.* to 'mtpadm'@'%' WITH GRANT OPTION;        

4. Modify my.ini and my.cnf

   Setup belows.
   *Although MySQL5.7 or later version has "my-default.ini" 
    in the directory where MySQL server's main unit is put, 
    please modify the another "my.ini" which is related to DB
    (my.ini in C:\ProgramData\MySQL as windows default).

   >Specify character code

    Setup to UTF-8

        [client]
        default-character-set=utf8mb4
        [mysql]
        default-character-set=utf8mb4
        [mysqld]
        character-set-server=utf8mb4

   >Setup belows because of file upload errors 

        [mysqld]
        max_allowed_packet=100M

   >The default of isolation level is the style to read the initial information of transaction.
    So change to similar style to Oracle.

        [mysqld]
        transaction-isolation=READ-COMMITTED

   >Disable query cash
     *for 5.7 only
    for the case of the wait state because of heavy query

        [mysqld]
        query_cache_size=0

   >By default, an index key for a single-column index can be up to 767 bytes.
     *for 5.7 only
     this length limit is raised to 3072 bytes 

        [mysqld]
        innodb_file_format = Barracuda
        innodb_file_per_table = 1
        innodb_large_prefix = 1

   >Specify time zone
     *for Connector/J 8.0 only

        [mysqld]
        default-time-zone='Asia/Tokyo'

      Change the time zone to be set according to the environment.
      The time zone data has to be imported.

  *Please modify other property depending on your environment or situation.

  After finishing the modification, please reboot MySQL.

5. Create tables, sequences and functions

   We have some kinds of DDL according to use.

      Use MySQL Page Compression : mysql_compress
      Use Pseudo-Partition : mysql_pseudo_128
      Not use MySQL Page Compression : mysql

   In addition to the above DDL, the following DDL is also available.

      Use Amazon Aurora MySQL : aurora_mysql

      *DDL for storage space with TEXT column redefined in varchar (192) to allow parallel queries in Amazon Aurora MySQL.
       In version 2 or earlier, this DDL is necessary to use parallel queries because parallel queries cannot be performed on TEXT type columns.
       In version 3 or later, parallel queries can be performed on TEXT type columns; you do not need to use DDL for aurora_mysql to use parallel queries.

   Execute CREATE_TABLE.ddl in the folder as an administrator user.

  *Notes!
    If you validate the binary log of MySQL, an error will be occured when you create function.
    In that case, please validate log_bin_trust_function_creators.

