Is production: true
#migrated #portal #mysql

Title: How setup mysql portable windows

Created: 20 Oct 2019 Modified: 20 Oct 2019

Description:



[Chinese reference]

The configuration covered only apply to testing environment.

Instructions

  1. Download portable version from mysql official site

  2. Extract to path assume the path to be Q:\\tools\\mysql\\mysql\\app

  3. Add config file my.cnf

    [mysqld]
    basedir = "q:\\tools\\mysql\\mysql\\app"
    datadir = "q:\\tools\\mysql\\mysql\\data"
    
    lower_case_table_name=1
    character-set-client-handshake = FALSE
    character-set-server = utf8mb4
    collation-server = utf8mb4_unicode_ci
    
    [client]
    default-character-set = utf8mb4
    [mysql]
    default-character-set = utf8mb4
    
  4. Add mysql binary path to system path

    set t_mysql_bin=q:\tools\mysql\mysql\app\bin
    set path=%t_mysql_bin%;%PATH%
    
  5. Add init.txt for initialize purpose, such as root password setup

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Abcd1234');
    
  6. create run script
    if initialise please run below script

    mysqld --defaults-file="q:\tools\mysql\mysql\my.cnf" --initialize  --init-file="q:\tools\mysql\mysql\init.txt"
    

    if run existing application

    mysqld --defaults-file="q:\tools\mysql\mysql\my.cnf" 
    
  7. If windows throw missing MSVCR120.dll exception, you may flow question to download windows vcrdist and install it.

[Legacy Link]