my koha-common.cnf is using this form: [client] host=db user=root password="move_rootpwd_to_dotenv" this file is working has expected with mysql tools. but koha-create parsing will not find the db host resulting in koha-conf.xml containing no values in hostname element. as a result trying to connect to the web serveur will raise an error : Software error: DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1490. at /usr/share/koha/lib/Koha/Database.pm line 90 Compilation failed in require at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 31. BEGIN failed--compilation aborted at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 31. For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.
adding spaces around the equal sign will resolve the issue the problem is in kohl-create function getmysqlhost() https://github.com/Koha-Community/Koha/blob/master/debian/scripts/koha-create#L124 the awk search require spaces
maybe something like that awk ' BEGIN { FS="=" } $1 ~/\[/ { inclient=0 } $1 ~/\[client\]/ { inclient=1 next } inclient==1 && $1 ~/host/ { print $2 } ' /etc/mysql/koha-common.cnf
Created attachment 63501 [details] [review] patch changing the awk script
Is this patch ready to sign off? I have an amendment to make. :)
Created attachment 64557 [details] [review] Bug 18564: MariaDB doesn't have a debian.cnf file The koha-common.cnf file is a link to debian.cnf, which MariaDB does not install. This just forces a 'localhost' return value.
(In reply to M. Tompsett from comment #5) > Created attachment 64557 [details] [review] [review] > Bug 18564: MariaDB doesn't have a debian.cnf file > > The koha-common.cnf file is a link to debian.cnf, which MariaDB > does not install. This just forces a 'localhost' return value. Please move it to its own bug report.
Created attachment 67371 [details] [review] Bug 18564: Improve koha-common.cnf parsing to pick the mysql host my koha-common.cnf is using this form: [client] host=db user=root password="move_rootpwd_to_dotenv" this file is working has expected with mysql tools. but koha-create parsing will not find the db host resulting in koha-conf.xml containing no values in hostname element. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 68315 [details] [review] Bug 18564: Improve koha-common.cnf parsing to pick the mysql host my koha-common.cnf is using this form: [client] host=db user=root password="move_rootpwd_to_dotenv" this file is working has expected with mysql tools. but koha-create parsing will not find the db host resulting in koha-conf.xml containing no values in hostname element. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thanks, Eric'. Looks good to me, improving my awk skills on the way..
Patch pushed to master for 17.11. Thanks and congrats Éric it is your first patch in!