Add suport for MariaDB 10.4. Compile with default charset utf8.

This commit is contained in:
Christoph 2019-07-02 15:36:52 +02:00
parent e09a181e77
commit ccb69889e7
8 changed files with 303 additions and 19 deletions

View File

@ -37,6 +37,28 @@ socket = /tmp/mysql.sock
#autocommit = 0
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
## - sql_mode
## -
## - To be compartible with older programming on mysql 5.6

View File

@ -35,6 +35,28 @@ innodb-open-files = 1048576
port = 3306
socket = /tmp/mysql.sock
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
## - sql_mode
## -
## - Since Version 8.0.11 NO_AUTO_CREATE_USER is no longer available

View File

@ -35,6 +35,29 @@ innodb-open-files = 1048576
port = 3306
socket = /tmp/mysql.sock
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
## - sql_mode
## -
## - Since Version 8.0.11 NO_AUTO_CREATE_USER is no longer available

View File

@ -36,6 +36,28 @@ port = 3306
socket = /tmp/mysql.sock
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
## - sql_mode
## -
## - To be compartible with older programming on mysql 5.6

View File

@ -35,6 +35,29 @@ innodb-open-files = 1048576
port = 3306
socket = /tmp/mysql.sock
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
## - sql_mode
## -
## - Since Version 8.0.11 NO_AUTO_CREATE_USER is no longer available

View File

@ -37,6 +37,28 @@ socket = /tmp/mysql.sock
#autocommit = 0
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
## - sql_mode
## -
## - To be compartible with older programming on mysql 5.6

View File

@ -8,6 +8,29 @@
## -
[mysqld]
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
log-error = /var/log/mysql/error.log

View File

@ -2114,7 +2114,9 @@ if [[ "$MYSQL_DISTRIBUTION" = "MariaDB" ]]; then
-DMYSQL_DATADIR=$MYSQL_DATA_DIR
-DENABLED_LOCAL_INFILE=ON
-DGRN_LOG_PATH=$mariadb_groonga_log
-DCONC_WITH_MYSQLCOMPAT=ON"
-DCONC_WITH_MYSQLCOMPAT=ON
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci"
if $INSTALL_SYSTEMD_SERVICE ; then
cmake_options="$cmake_options
@ -2140,7 +2142,8 @@ else
-DENABLED_LOCAL_INFILE=1
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=$MYSQL_INSTALL_DIR
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
"
if $INSTALL_SYSTEMD_SERVICE ; then
@ -2919,6 +2922,28 @@ innodb-open-files = $(ulimit -Hn)
port = $MYSQL_PORT
socket = $MYSQL_UNIX_SOCKET
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
" >> ${logdir}/main.log
if [[ "$MYSQL_MAJOR_VERSION" -gt 8 ]] \
@ -3843,6 +3868,28 @@ innodb-open-files = $(ulimit -Hn)
port = $MYSQL_PORT
socket = $MYSQL_UNIX_SOCKET
## - character-set-server
## -
## - The servers default character set. If you set this variable, you should also
## - set collation_server to specify the collation for the character set.
## -
## - See also: https://dev.mysql.com/doc/refman/8.0/en/charset-configuration.html
## -
## - The default depend on cmake options:
## -
## - cmake . \
## - ...
## - -DDEFAULT_CHARSET=latin1 \
## - -DDEFAULT_COLLATION=latin1_german1_ci
## -
#character-set-server = utf8
## - collation-server
## -
## - The server's default collation. See Section 10.14, “Character Set Configuration”.
#collation-server = utf8_general_ci
EOF
if [[ "$MYSQL_MAJOR_VERSION" -gt 8 ]] \
|| ( [[ "$MYSQL_MAJOR_VERSION" -eq 8 ]] && [[ "$MYSQL_MINOR_VERSION" -gt 0 ]] ) \
@ -5299,6 +5346,58 @@ if ! $UPDATE_MYSQL ; then
## - Set root password
## -
if [[ "$MYSQL_DISTRIBUTION" = "MariaDB" ]] \
&& [[ $MYSQL_MINOR_VERSION -ge 4 ]] ; then
echononl "Setze root Passwort für den MySQL Zugang"
echo "" >> ${logdir}/main.log
echo "## - Setze root Passwort für den MariaDB Zugang" >> ${logdir}/main.log
echo "## -" >> ${logdir}/main.log
echo "${MYSQL_INSTALL_DIR}/bin/mysql -S $MYSQL_UNIX_SOCKET -uroot mysql -N -s -e \"ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD('$MYSQL_ROOT_PW')\"" >> ${logdir}/main.log
${MYSQL_INSTALL_DIR}/bin/mysql -S $MYSQL_UNIX_SOCKET -uroot mysql -N -s -e "ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD('$MYSQL_ROOT_PW')" \
>> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error Konnte root Passwort für den MariaDB Server nicht setzen..
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi
## - Flush privileges
## -
echononl "Neu Einlesen der Berechtigung (MySQL Server).."
echo "" >> ${logdir}/main.log
echo "## - Neu Einlesen der Berechtigung (MySQL Server)" >> ${logdir}/main.log
echo "## -" >> ${logdir}/main.log
echo "${MYSQL_INSTALL_DIR}/bin/mysql -S $MYSQL_UNIX_SOCKET -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log
${MYSQL_INSTALL_DIR}/bin/mysql -S $MYSQL_UNIX_SOCKET -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen..
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi
elif [[ "$MYSQL_DISTRIBUTION" = "MariaDB" ]] \
|| ( [[ "$MYSQL_DISTRIBUTION" = "MySQL" ]] \
&& [[ $MYSQL_MAJOR_VERSION -eq 5 ]] \
&& [[ $MYSQL_MINOR_VERSION -le 6 ]] ); then
@ -5650,26 +5749,54 @@ if ! $UPDATE_MYSQL || $_sys_maint_cnf_needed ; then
fi # if [[ "$MYSQL_MAJOR_VERSION" -lt 8 ]]
echononl "Give 'Grant' permission to MySQL User '${_maint_user}'.."
echo "" >> ${logdir}/main.log
echo "## - Give 'Grant' permission to MySQL User '${_maint_user}'" >> ${logdir}/main.log
echo "## -" >> ${logdir}/main.log
echo "${MYSQL_INSTALL_DIR}/bin/mysql -S $MYSQL_UNIX_SOCKET -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"UPDATE user SET Grant_priv = 'y' WHERE user = '${_maint_user}';\"" >> ${logdir}/main.log
${MYSQL_INSTALL_DIR}/bin/mysql -S $MYSQL_UNIX_SOCKET -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "UPDATE user SET Grant_priv = 'y' WHERE user = '${_maint_user}';" >> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error Giving \"Grant\"-permission to \(MySQL\) User \"${_maint_user}\" failed
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
if [[ "$MYSQL_DISTRIBUTION" = "MariaDB" ]] \
&& [[ $MYSQL_MINOR_VERSION -ge 4 ]] ; then
# - All user accounts, passwords, and global privileges are now stored in
# - the mysql.global_priv table. The mysql.user table still exists and has
# - exactly the same set of columns as before, but its now a view that
# - references the mysql.global_priv table. Tools that analyze the mysql.user
# - table should continue to workas before.
# -
# - See also:
# - https://mariadb.com/kb/en/library/authentication-from-mariadb-104/
echo_skipped
warn "Column 'Grant_priv' is not updatable.
However, root@localhost user is allowed to login without a password
via the local Unix socket file defined by the socket system variable,
as long as the login is attempted from a process owned by the operating
system root user account.
as user root use:
\033[37m\033[1mmysql -S $MYSQL_UNIX_SOCKET\033[m"
else
echo "" >> ${logdir}/main.log
echo "## - Give 'Grant' permission to MySQL User '${_maint_user}'" >> ${logdir}/main.log
echo "## -" >> ${logdir}/main.log
echo "${MYSQL_INSTALL_DIR}/bin/mysql -S $MYSQL_UNIX_SOCKET -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"UPDATE user SET Grant_priv = 'y' WHERE user = '${_maint_user}';\"" >> ${logdir}/main.log
${MYSQL_INSTALL_DIR}/bin/mysql -S $MYSQL_UNIX_SOCKET -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "UPDATE user SET Grant_priv = 'y' WHERE user = '${_maint_user}';" >> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error Giving \"Grant\"-permission to \(MySQL\) User \"${_maint_user}\" failed
echononl "continue anyway [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi
fi
echononl "Neu Einlesen der Berechtigung (MySQL Server).."