diff -Nru mysql-5.7-5.7.13/debian/changelog mysql-5.7-5.7.13/debian/changelog --- mysql-5.7-5.7.13/debian/changelog 2016-07-14 21:16:56.000000000 +0800 +++ mysql-5.7-5.7.13/debian/changelog 2016-08-27 15:47:02.000000000 +0800 @@ -1,3 +1,10 @@ +mysql-5.7 (5.7.13-0ubuntu5) yakkety; urgency=medium + + * Fix MySQL Server installation freezes if root password contains single + quotes (LP: #1598992) + + -- Gasol Wu Sat, 27 Aug 2016 15:47:02 +0800 + mysql-5.7 (5.7.13-0ubuntu4) yakkety; urgency=medium * Check that /etc/mysql/my.cnf.migrated exists before attempting to diff -Nru mysql-5.7-5.7.13/debian/mysql-server-5.7.postinst mysql-5.7-5.7.13/debian/mysql-server-5.7.postinst --- mysql-5.7-5.7.13/debian/mysql-server-5.7.postinst 2016-07-14 21:14:49.000000000 +0800 +++ mysql-5.7-5.7.13/debian/mysql-server-5.7.postinst 2016-08-27 15:47:02.000000000 +0800 @@ -12,6 +12,11 @@ # This command can be used as pipe to syslog. With "-s" it also logs to stderr. ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i" +quote() { + local text=$1 + echo ${text//\'/\\\'} +} + # Runs an arbitrary init sql file supplied in $1. Does not require login access run_init_sql() { tmpdir=`mktemp -d` @@ -221,7 +226,7 @@ chmod 600 "$initfile" chown mysql:mysql "$initfile" echo "USE mysql; " >> "$initfile" - db_get mysql-server/root_password && rootpw="$RET" + db_get mysql-server/root_password && rootpw=`quote "$RET"` if [ ! -z "$rootpw" ]; then echo "ALTER USER 'root'@'localhost' IDENTIFIED BY '$rootpw';" >> "$initfile" fi @@ -281,7 +286,7 @@ # auth_socket plugin and enable it for the root user to improve # security. if test_mysql_access; then - db_get mysql-server/root_password && rootpw="$RET" + db_get mysql-server/root_password && rootpw=`quote "$RET"` if [ ! -z "$rootpw" ]; then invoke stop initfile=`mktemp --tmpdir=/var/lib/mysql-files/`