|
@@ -8,7 +8,7 @@
|
|
|
# https://oneinstack.com
|
|
|
# https://github.com/oneinstack/oneinstack
|
|
|
|
|
|
-Install_MariaDB103() {
|
|
|
+Install_MariaDB106() {
|
|
|
pushd ${oneinstack_dir}/src > /dev/null
|
|
|
id -u mysql >/dev/null 2>&1
|
|
|
[ $? -ne 0 ] && useradd -M -s /sbin/nologin mysql
|
|
@@ -17,15 +17,15 @@ Install_MariaDB103() {
|
|
|
mkdir -p ${mariadb_data_dir};chown mysql.mysql -R ${mariadb_data_dir}
|
|
|
|
|
|
if [ "${dbinstallmethod}" == "1" ]; then
|
|
|
- tar zxf mariadb-${mariadb103_ver}-linux-${SYS_BIT_b}.tar.gz
|
|
|
- mv mariadb-${mariadb103_ver}-linux-${SYS_BIT_b}/* ${mariadb_install_dir}
|
|
|
+ tar zxf mariadb-${mariadb106_ver}-linux-systemd-${SYS_BIT_b}.tar.gz
|
|
|
+ mv mariadb-${mariadb106_ver}-linux-systemd-${SYS_BIT_b}/* ${mariadb_install_dir}
|
|
|
sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${mariadb_install_dir}/bin/mysqld_safe
|
|
|
sed -i "s@/usr/local/mysql@${mariadb_install_dir}@g" ${mariadb_install_dir}/bin/mysqld_safe
|
|
|
elif [ "${dbinstallmethod}" == "2" ]; then
|
|
|
boostVersion2=$(echo ${boost_oldver} | awk -F. '{print $1"_"$2"_"$3}')
|
|
|
tar xzf boost_${boostVersion2}.tar.gz
|
|
|
- tar xzf mariadb-${mariadb103_ver}.tar.gz
|
|
|
- pushd mariadb-${mariadb103_ver}
|
|
|
+ tar xzf mariadb-${mariadb106_ver}.tar.gz
|
|
|
+ pushd mariadb-${mariadb106_ver}
|
|
|
cmake . -DCMAKE_INSTALL_PREFIX=${mariadb_install_dir} \
|
|
|
-DMYSQL_DATADIR=${mariadb_data_dir} \
|
|
|
-DDOWNLOAD_BOOST=1 \
|
|
@@ -52,9 +52,9 @@ Install_MariaDB103() {
|
|
|
sed -i "s+^dbrootpwd.*+dbrootpwd='${dbrootpwd}'+" ../options.conf
|
|
|
echo "${CSUCCESS}MariaDB installed successfully! ${CEND}"
|
|
|
if [ "${dbinstallmethod}" == "1" ]; then
|
|
|
- rm -rf mariadb-${mariadb103_ver}-linux-${SYS_BIT_b}
|
|
|
+ rm -rf mariadb-${mariadb106_ver}-linux-systemd-${SYS_BIT_b}
|
|
|
elif [ "${dbinstallmethod}" == "2" ]; then
|
|
|
- rm -rf mariadb-${mariadb103_ver} boost_${boostVersion2}
|
|
|
+ rm -rf mariadb-${mariadb106_ver} boost_${boostVersion2}
|
|
|
fi
|
|
|
else
|
|
|
rm -rf ${mariadb_install_dir}
|
|
@@ -75,6 +75,7 @@ Install_MariaDB103() {
|
|
|
[client]
|
|
|
port = 3306
|
|
|
socket = /tmp/mysql.sock
|
|
|
+default-character-set = utf8mb4
|
|
|
|
|
|
[mysqld]
|
|
|
port = 3306
|
|
@@ -205,7 +206,7 @@ EOF
|
|
|
|
|
|
${mariadb_install_dir}/bin/mysql -e "grant all privileges on *.* to root@'127.0.0.1' identified by \"${dbrootpwd}\" with grant option;"
|
|
|
${mariadb_install_dir}/bin/mysql -e "grant all privileges on *.* to root@'localhost' identified by \"${dbrootpwd}\" with grant option;"
|
|
|
- ${mariadb_install_dir}/bin/mysql -uroot -p${dbrootpwd} -e "delete from mysql.user where Password='' where User not like 'mariadb.%';"
|
|
|
+ ${mariadb_install_dir}/bin/mysql -uroot -p${dbrootpwd} -e "delete from mysql.user where Password='' and User not like 'mariadb.%';"
|
|
|
${mariadb_install_dir}/bin/mysql -uroot -p${dbrootpwd} -e "delete from mysql.db where User='';"
|
|
|
${mariadb_install_dir}/bin/mysql -uroot -p${dbrootpwd} -e "delete from mysql.proxies_priv where Host!='localhost';"
|
|
|
${mariadb_install_dir}/bin/mysql -uroot -p${dbrootpwd} -e "drop database test;"
|