Tutorial Multiple MariaDb (installation and usage) on Windows OS (version 2)


Download MariaDb as zip format https://mariadb.org/mariadb/all-releases

Example I download files mariadb-v5.5.68, mariadb-v10.0.34, mariadb-v10.6.27, mariadb-v10.11.18, mariadb-v11.4.12, mariadb-v11.8.8, mariadb-v12.3.2

Orchestrated your mariadb with multiple port, example :
* mariadb-v5.5.68 = 3321
* mariadb-v10.0.34 = 3322
* mariadb-v10.6.27 = 3323
* mariadb-v10.11.18 = 3324
* mariadb-v11.4.12 = 3325
* mariadb-v11.8.8 = 3326
* mariadb-v12.3.2 = 3327

Example I extracted those files above into directory C:\Wnmp\mariadb-bins









Now, let's begin installation process.

* MariaDB-v5.5.68 (port 3321)

Create file mariadb-p3321.sock in C:\Wnmp\mariadb-bins\5.5.68\tmp\mariadb-p3321.sock

Create file my.ini in C:\Wnmp\mariadb-bins\5.5.68\my.ini and paste these configurations :
[client]
port = 3321
socket = C:/Wnmp/mariadb-bins/5.5.68/tmp/mariadb-p3321.sock
plugin-dir = C:/Wnmp/mariadb-bins/5.5.68/lib/plugin

[mysqld]
port = 3321
socket = C:/Wnmp/mariadb-bins/5.5.68/tmp/mariadb-p3321.sock
datadir = C:/Wnmp/mariadb-bins/5.5.68/data
back_log = 50
max_connections = 100
max_connect_errors = 10
table_open_cache = 2048
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 64M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
thread_cache_size = 8
thread_concurrency = 8
query_cache_size = 64M
query_cache_limit = 2M
ft_min_word_len = 4
default-storage-engine = MYISAM
thread_stack = 240K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 64M
log-bin=mysql-bin
binlog_format=mixed
slow_query_log
long_query_time = 2
server-id = 1
key_buffer_size = 32M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 2G
innodb_data_file_path = ibdata1:10M:autoextend
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
open-files-limit = 8192

---   ---   ---   ---   ---

Open command prompt and run as administrator

$ cd C:\Wnmp\mariadb-bins\5.5.68\bin

$ mysqld.exe --install "MariaDB_p3321_v5.5.68" --defaults-file="C:\Wnmp\mariadb-bins\5.5.68\my.ini"

$ mysql_install_db.exe --datadir="C:\Wnmp\mariadb-bins\5.5.68\data"

$ net start "MariaDB_p3321_v5.5.68"

$ mysql -u root -p (enter)

$ use mysql;

$ GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'type_your_password' WITH GRANT OPTION;

$ FLUSH PRIVILEGES;

$ exit

$ mysql -u root -p (enter, then type your password, then enter again)

--------------------------------------------------

* MariaDB-v10.0.34 (port 3322)

Create file mariadb-p3322.sock in C:\Wnmp\mariadb-bins\10.0.34\tmp\mariadb-p3322.sock

Create file my.ini in C:\Wnmp\mariadb-bins\10.0.34\my.ini and paste these configurations :
[client]
port = 3322
socket = C:/Wnmp/mariadb-bins/10.0.34/tmp/mariadb-p3322.sock
plugin-dir = C:/Wnmp/mariadb-bins/10.0.34/lib/plugin

[mysqld]
port = 3322
socket = C:/Wnmp/mariadb-bins/10.0.34/tmp/mariadb-p3322.sock
datadir = C:/Wnmp/mariadb-bins/10.0.34/data
back_log = 50
max_connections = 100
max_connect_errors = 10
table_open_cache = 2048
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 64M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
thread_cache_size = 8
thread_concurrency = 8
query_cache_size = 64M
query_cache_limit = 2M
ft_min_word_len = 4
default-storage-engine = MYISAM
thread_stack = 240K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 64M
log-bin=mysql-bin
binlog_format=mixed
slow_query_log
long_query_time = 2
server-id = 1
key_buffer_size = 32M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 2G
innodb_data_file_path = ibdata1:10M:autoextend
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
open-files-limit = 8192

---   ---   ---   ---   ---
Open command prompt and run as administrator

$ cd C:\Wnmp\mariadb-bins\10.0.34\bin

$ mysqld.exe --install "MariaDB_p3322_v10.0.34" --defaults-file="C:\Wnmp\mariadb-bins\10.0.34\my.ini"

$ mysql_install_db.exe --datadir="C:\Wnmp\mariadb-bins\10.0.34\data"

$ net start "MariaDB_p3322_v10.0.34"

$ mysql -u root -p (enter)

$ use mysql;

$ GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'type_your_password' WITH GRANT OPTION;

$ FLUSH PRIVILEGES;

$ exit

$ mysql -u root -p (enter, then type your password, then enter again)

--------------------------------------------------

* MariaDB-v10.6.27 (port 3323)

Create file mariadb-p3323.sock in C:\Wnmp\mariadb-bins\10.6.27\tmp\mariadb-p3323.sock

Create file my.ini in C:\Wnmp\mariadb-bins\10.6.27\my.ini and paste these configurations :
[client]
port = 3323
socket = C:/Wnmp/mariadb-bins/10.6.27/tmp/mariadb-p3323.sock
plugin-dir = C:/Wnmp/mariadb-bins/10.6.27/lib/plugin

[mysqld]
port = 3323
socket = C:/Wnmp/mariadb-bins/10.6.27/tmp/mariadb-p3323.sock
datadir = C:/Wnmp/mariadb-bins/10.6.27/data
max_connections = 20
back_log = 50
max_connect_errors = 10000
innodb_buffer_pool_size = 2G
innodb_log_file_size = 512M
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
thread_cache_size = 16
sysdate_is_now = 1
tmp_table_size = 64M
max_heap_table_size = 64M
key_buffer_size = 32M
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
join_buffer_size = 4M

---   ---   ---   ---   ---

Open command prompt and run as administrator

$ cd C:\Wnmp\mariadb-bins\10.6.27\bin

$ mysqld.exe --install "MariaDB_p3323_v10.6.27" --defaults-file="C:\Wnmp\mariadb-bins\10.6.27\my.ini"

$ mysql_install_db.exe --datadir="C:\Wnmp\mariadb-bins\10.6.27\data"

$ net start "MariaDB_p3323_v10.6.27"

$ mysql -u root -p (enter)

$ use mysql;

$ GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'type_your_password' WITH GRANT OPTION;

$ FLUSH PRIVILEGES;

$ exit

$ mysql -u root -p (enter, then type your password, then enter again)

--------------------------------------------------

* MariaDB-v10.11.18 (port 3324)

Create file mariadb-p3324.sock in C:\Wnmp\mariadb-bins\10.11.18\tmp\mariadb-p3324.sock

Create file my.ini in C:\Wnmp\mariadb-bins\10.11.18\my.ini and paste these configurations :
[client]
port = 3324
socket = C:/Wnmp/mariadb-bins/10.11.18/tmp/mariadb-p3324.sock
plugin-dir = C:/Wnmp/mariadb-bins/10.11.18/lib/plugin

[mysqld]
port = 3324
socket = C:/Wnmp/mariadb-bins/10.11.18/tmp/mariadb-p3324.sock
datadir = C:/Wnmp/mariadb-bins/10.11.18/data
innodb_buffer_pool_size  = 2560M
innodb_log_buffer_size   = 16M
max_connections          = 50
back_log                 = 100
thread_cache_size        = 16
sort_buffer_size         = 4M
join_buffer_size         = 4M
read_buffer_size         = 1M
read_rnd_buffer_size     = 4M
max_allowed_packet       = 32M
table_open_cache         = 2048
tmp_table_size           = 64M
max_heap_table_size      = 64M
innodb_flush_method      = unbuffered

---   ---   ---   ---   ---

Open command prompt and run as administrator

$ cd C:\Wnmp\mariadb-bins\10.11.18\bin

$ mysqld.exe --install "MariaDB_p3324_v10.11.18" --defaults-file="C:\Wnmp\mariadb-bins\10.11.18\my.ini"

$ mysql_install_db.exe --datadir="C:\Wnmp\mariadb-bins\10.11.18\data"

$ net start "MariaDB_p3324_v10.11.18"

$ mysql -u root -p (enter)

$ use mysql;

$ GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'type_your_password' WITH GRANT OPTION;

$ FLUSH PRIVILEGES;

$ exit

$ mysql -u root -p (enter, then type your password, then enter again)

--------------------------------------------------

* MariaDB-v11.4.12 (port 3325)

Create file mariadb-p3325.sock in C:\Wnmp\mariadb-bins\11.4.12\tmp\mariadb-p3325.sock

Create file my.ini in C:\Wnmp\mariadb-bins\11.4.12\my.ini and paste these configurations :
[client]
port = 3325
socket = C:/Wnmp/mariadb-bins/11.4.12/tmp/mariadb-p3325.sock
plugin-dir = C:/Wnmp/mariadb-bins/11.4.12/lib/plugin

[mysqld]
port = 3325
socket = C:/Wnmp/mariadb-bins/11.4.12/tmp/mariadb-p3325.sock
datadir = C:/Wnmp/mariadb-bins/11.4.12/data
max_connections         = 100
max_allowed_packet      = 16M
max_heap_table_size     = 64M
tmp_table_size          = 64M
innodb_buffer_pool_size         = 2G
innodb_log_file_size            = 512M
innodb_log_buffer_size          = 16M
innodb_flush_log_at_trx_commit  = 1
innodb_flush_method             = async_unbuffered
innodb_file_per_table           = 1
table_open_cache                = 2048
thread_cache_size               = 16

---   ---   ---   ---   ---

Open command prompt and run as administrator

$ cd C:\Wnmp\mariadb-bins\11.4.12\bin

$ mysqld.exe --install "MariaDB_p3325_v11.4.12" --defaults-file="C:\Wnmp\mariadb-bins\11.4.12\my.ini"

$ mysql_install_db.exe --datadir="C:\Wnmp\mariadb-bins\11.4.12\data"

$ net start "MariaDB_p3325_v11.4.12"

$ mysql -u root -p (enter)

$ use mysql;

$ GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'type_your_password' WITH GRANT OPTION;

$ FLUSH PRIVILEGES;

$ exit

$ mysql -u root -p (enter, then type your password, then enter again)

--------------------------------------------------

* MariaDB-v11.8.8 (port 3326)

Create file mariadb-p3326.sock in C:\Wnmp\mariadb-bins\11.8.8\tmp\mariadb-p3326.sock

Create file my.ini in C:\Wnmp\mariadb-bins\11.8.8\my.ini and paste these configurations :
[client]
port = 3326
socket = C:/Wnmp/mariadb-bins/11.8.8/tmp/mariadb-p3326.sock
plugin-dir = C:/Wnmp/mariadb-bins/11.8.8/lib/plugin

[mysqld]
port = 3326
socket = C:/Wnmp/mariadb-bins/11.8.8/tmp/mariadb-p3326.sock
datadir = C:/Wnmp/mariadb-bins/11.8.8/data
max_connections = 100
max_allowed_packet = 64M
innodb_buffer_pool_size = 3G
innodb_log_file_size = 512M
innodb_log_buffer_size = 32M
innodb_flush_method = O_DIRECT_NO_FSYNC
innodb_flush_log_at_trx_commit = 1
key_buffer_size = 16M
aria_pagecache_buffer_size = 32M
table_open_cache = 2000
table_definition_cache = 1000
thread_cache_size = 16

---   ---   ---   ---   ---

Open command prompt and run as administrator

$ cd C:\Wnmp\mariadb-bins\11.8.8\bin

$ mysqld.exe --install "MariaDB_p3326_v11.8.8" --defaults-file="C:\Wnmp\mariadb-bins\11.8.8\my.ini"

$ mysql_install_db.exe --datadir="C:\Wnmp\mariadb-bins\11.8.8\data"

$ net start "MariaDB_p3326_v11.8.8"

$ mysql -u root -p (enter)

$ use mysql;

$ GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'type_your_password' WITH GRANT OPTION;

$ FLUSH PRIVILEGES;

$ exit

$ mysql -u root -p (enter, then type your password, then enter again)

--------------------------------------------------

* MariaDB-v12.3.2 (port 3327)

Create file mariadb-p3327.sock in C:\Wnmp\mariadb-bins\12.3.2\tmp\mariadb-p3327.sock

Create file my.ini in C:\Wnmp\mariadb-bins\12.3.2\my.ini and paste these configurations :
[client]
port = 3327
socket = C:/Wnmp/mariadb-bins/12.3.2/tmp/mariadb-p3327.sock
plugin-dir = C:/Wnmp/mariadb-bins/12.3.2/lib/plugin

[mysqld]
port = 3327
socket = C:/Wnmp/mariadb-bins/12.3.2/tmp/mariadb-p3327.sock
datadir = C:/Wnmp/mariadb-bins/12.3.2/data
max_connections         = 100         # Lower connection count allows more RAM per query
table_open_cache        = 2048
max_allowed_packet      = 16M
sort_buffer_size        = 2M          # Per-thread memory
read_buffer_size        = 2M          # Per-thread memory
read_rnd_buffer_size    = 8M          # Per-thread memory
join_buffer_size        = 8M          # Per-thread memory
thread_cache_size       = 16
tmp_table_size          = 64M
max_heap_table_size     = 64M
innodb_buffer_pool_size         = 2G
innodb_buffer_pool_instances    = 2   # Improves concurrency (1 pool per 1GB)
innodb_log_buffer_size          = 16M
innodb_log_file_size            = 512M
innodb_log_files_in_group       = 2
innodb_flush_log_at_trx_commit  = 1
innodb_read_io_threads          = 8
innodb_write_io_threads         = 8
innodb_thread_concurrency       = 16

---   ---   ---   ---   ---

Open command prompt and run as administrator

$ cd C:\Wnmp\mariadb-bins\12.3.2\bin

$ mysqld.exe --install "MariaDB_p3327_v12.3.2" --defaults-file="C:\Wnmp\mariadb-bins\12.3.2\my.ini"

$ mysql_install_db.exe --datadir="C:\Wnmp\mariadb-bins\12.3.2\data"

$ net start "MariaDB_p3327_v12.3.2"

$ mysql -u root -p (enter)

$ use mysql;

$ GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'type_your_password' WITH GRANT OPTION;

$ FLUSH PRIVILEGES;

$ exit

$ mysql -u root -p (enter, then type your password, then enter again)

Comments