Bug 19547: Deal with --create-db missing debian.cnf issue

Followed test plan. Patch functions as described and both commands execute.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 931db23ee3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Mark Tompsett 2017-10-31 02:28:58 +00:00 committed by Fridolin Somers
parent a92494aec3
commit 77c752d393
1 changed files with 7 additions and 1 deletions

View File

@ -677,7 +677,13 @@ then
# Set up MySQL database for this instance.
if [ "$op" = create ]
then
mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
if [ ! -e /etc/mysql/debian.cnf ]; then
MYSQL_OPTIONS="-u root"
echo "WARNING: The koha-common.cnf file is a dead soft link!"
else
MYSQL_OPTIONS="--defaults-extra-file=/etc/mysql/koha-common.cnf"
fi
mysql $MYSQL_OPTIONS <<eof
CREATE DATABASE \`$mysqldb\`;
CREATE USER \`$mysqluser\`@'$mysql_hostname' IDENTIFIED BY '$mysqlpwd';
CREATE USER \`$mysqluser\`@'%' IDENTIFIED BY '$mysqlpwd';