Skip to content

Draft: Thatoo develop patch 18635Database Requirements whith --no-setup-db parameter

Thatoo requested to merge Thatoo/dodock:Thatoo-develop-patch-18635 into develop

In order to gain flexibility to write Dokos install script and packages, the --no-setup-db parameter of the bench new-site command is a very great improvement!

However, in order to free installation from the need of adding to /etc/mysql/my.cnf

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

the command bench new-site with the --no-setup-db parameter should check these requirements :

			"character_set_database": "utf8mb4",
			"collation_database": "utf8mb4_unicode_ci"

and not necessarily the GLOBAL mysql VARIABLES.

With this PR, the following :

sudo mysql -u root -e "CREATE USER '$db_name'@'localhost' IDENTIFIED BY '$db_pwd';"
sudo mysql -u root -e "CREATE DATABASE IF NOT EXISTS $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON $db_name . * TO '$db_name'@'localhost';"
sudo mysql -u root -e "FLUSH PRIVILEGES;"

bench new-site $site_name --db-name $db_name --db-password $db_pwd --no-setup-db --admin-password $admin_pwd

could work without changing /etc/mysql/my.cnf .

Merge request reports