522acfa3342235ba4fc6292c6d282fff85d22b13 max Tue Mar 1 05:21:31 2022 -0800 hopefully last bugfix for mysql strict mode issue in gbic, refs #28733 diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh index daf8ddc..f173443 100755 --- src/product/installer/browserSetup.sh +++ src/product/installer/browserSetup.sh @@ -518,30 +518,37 @@ # Centos 6-8 MYCNF=/etc/my.cnf elif [ -f /etc/mysql/my.cnf ] ; then # Ubuntu 14 MYCNF=/etc/mysql/my.cnf elif [ -f /etc/mysql/mysql.conf.d/mysqld.cnf ] ; then # Ubuntu 16, 18, 20 MYCNF=/etc/mysql/mysql.conf.d/mysqld.cnf else echo Could not find my.cnf. Adapt 'setMYCNF()' in browserSetup.sh and/or contact us. exit 1 fi echo Found Mariadb config file: $MYCNF } +function mysqlStrictModeOff () +{ +# make sure that missing values in mysql insert statements do not trigger errors, #18368 = deactivate strict mode +setMYCNF +sed -Ei '/^.(mysqld|server).$/a sql_mode=' $MYCNF +} + function mysqlAllowOldPasswords # mysql >= 8 does not allow the old passwords anymore. But our client is still compiled # with the old, non-SHA256 encryption. So we must deactivate this new feature. # What will MariaDB do? { echo2 'Checking for Mysql version >= 8' MYSQLMAJ=`mysql -e 'SHOW VARIABLES LIKE "version";' -NB | cut -f2 | cut -d. -f1` setMYCNF if [ "$MYSQLMAJ" -ge 8 ] ; then echo2 'Mysql >= 8 found, checking if default-authentication allows native passwords' if grep -q default-authentication $MYCNF; then echo2 "default-authentication already set in $MYCNF" else echo2 Changing $MYCNF to allow native passwords and restarting Mysql @@ -762,32 +769,31 @@ MYSQLVER=`mysql --version` if [[ $MYSQLVER =~ "MariaDB" ]]; then MYSQLD=mariadb fi # start mysql on boot chkconfig --level 2345 $MYSQLD on # start mysql now /sbin/service $MYSQLD start secureMysql SET_MYSQL_ROOT=1 # make sure that missing values in Mysql insert statements do not trigger errors, #18368: deactivate strict mode - setMYCNF - sed -Ei '/^.(mysqld|server).$/a sql_mode=' $MYCNF + mysqlStrictModeOff else echo2 Mysql already installed fi # MySQL-python is required for hgGeneGraph # CentOS up to and including 7 default to python2, so MySQL-python is in the repos if yum list MySQL-python 2> /dev/null ; then yum -y install MySQL-python # Centos 8 defaults to python3 and it does not have a package MySQL-python anymore # So we install python2, the mysql libraries and fix up my_config.h manually # This is strange, but I was unable to find a different working solution. MariaDB simply does not have my_config.h else yum install -y python2 mysql-devel python2-devel wget gcc if [ -f /usr/include/mysql/my_config.h ]; then echo my_config.h found @@ -1017,33 +1023,32 @@ if [[ ! -f /usr/sbin/mysqld ]]; then echo2 echo2 Now installing the Mysql server. echo2 The root password will be set to a random string and will be written echo2 to the file /root/.my.cnf so root does not have to provide a password on echo2 the command line. waitKey moveAwayMyCnf # do not prompt in apt-get, will set an empty mysql root password export DEBIAN_FRONTEND=noninteractive # Debian / Ubuntu 20 defaults to Mysql 8 and Mysql 8 does not allow rsync of myisam anymore # -> we require mariaDb now # apt-get --assume-yes install mysql-server apt-get --assume-yes install mariadb-server - # make sure that missing values do not trigger errors, #18368: deactivate strict mode - setMYCNF - sed -Ei '/^.(mysqld|server).$/a' $MYCNF + + mysqlStrictModeOff # flag so script will set mysql root password later to a random value SET_MYSQL_ROOT=1 fi } # download apache mysql libpng openssl into the current dir # and build them into $APACHEDIR/ext function buildApacheMysqlOpensslLibpng () { echo2 echo2 Now building cmake, openssl, pcre, apache and mysql into $APACHEDIR/ext echo2 This can take up to 20 minutes on slower machines waitKey # cmake - required by mysql