| Server IP : 34.87.99.72 / Your IP : 216.73.217.31 Web Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1n System : Linux zlock-bitnami-lamp-prod-v2-vm 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 User : bitnami ( 1000) PHP Version : 7.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /opt/bitnami/scripts/mysql/ |
Upload File : |
#!/bin/bash
# shellcheck disable=SC1091
set -o errexit
set -o nounset
set -o pipefail
# set -o xtrace # Uncomment this line for debugging purposes
# Load libraries
. /opt/bitnami/scripts/libfs.sh
. /opt/bitnami/scripts/libos.sh
. /opt/bitnami/scripts/libmysql.sh
# Load MySQL environment variables
. /opt/bitnami/scripts/mysql-env.sh
# Ensure mysql unix socket file does not exist
rm -rf "${DB_SOCKET_FILE}.lock"
# Ensure MySQL environment variables settings are valid
mysql_validate
# Ensure MySQL is stopped when this script ends.
trap "mysql_stop" EXIT
if am_i_root; then
# Ensure 'daemon' user exists when running as 'root'
ensure_user_exists "$DB_DAEMON_USER" --group "$DB_DAEMON_GROUP"
# Fix logging issue when running as root
chmod o+w "$(readlink /dev/stdout)"
fi
# Ensure MySQL is initialized
mysql_initialize
# Allow running custom initialization scripts
mysql_custom_init_scripts
# Stop MySQL before flagging it as fully initialized.
# Relying only on the trap defined above could produce a race condition.
mysql_stop
# Load additional required libraries
# shellcheck disable=SC1091
. /opt/bitnami/scripts/libos.sh
. /opt/bitnami/scripts/libfile.sh
. /opt/bitnami/scripts/libversion.sh
# Enable 'innodb_dedicated_server' configuration option for MySQL 8 dedicated servers (and disable other incompatible options)
major_version="$(get_sematic_version "$(mysql_get_version)" 1)"
if [[ "$major_version" -ge "8" ]] && [[ -n "$DB_IS_DEDICATED_SERVER" ]] && is_boolean_yes "$DB_IS_DEDICATED_SERVER"; then
read -r -a supported_machine_sizes <<< "$(get_supported_machine_sizes)"
for machine_size in "${supported_machine_sizes[@]}"; do
replace_in_file "${DB_CONF_DIR}/bitnami/memory/my-${machine_size}.conf" '^\s*#?(\s*innodb_dedicated_server\s*=)' '\1'
replace_in_file "${DB_CONF_DIR}/bitnami/memory/my-${machine_size}.conf" '^\s*#?(\s*innodb_buffer_pool_size\s*=)' '#\1'
done
fi