Bug 20500

Summary: koha-create fails to connect to mysql
Product: Koha Reporter: Oleg Vasylenko <synapse.ova>
Component: PackagingAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, katrin.fischer, mirko, rudolfbyker
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Oleg Vasylenko 2018-03-29 19:47:21 UTC
On VPS server (used Debian 8 and Ubuntu 16.04) installed Vesta CP, then installed Koha (17.11). MySQL version 5.5.59-0+deb8u1 (Debian). Everything was fine until I tried to create koha db:

# sudo koha-create --create-db lib
ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

I found out that user debian-sys-maint is present on DB. Password, that is written in config file is the right one. The db user has enough privileges.

The same problem was happening even if I tried to connect to MySQL with code, written in koha-create script:

# mysql --defaults-extra-file=/etc/mysql/koha-common.cnf
ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

I tried wrapping options with quote marks, removing extra spaces in .cnf file but with no result.

But somehow everything was fine after I changed option "defaults-extra-file" to "defaults-file". 
Just in case, these lines are contained in files:
 • koha-create
 • koha-remove
 • koha-reset-passwd
 • koha-restore (3 times)
On installed system you can find them in the /usr/sbin/ folder
Comment 1 Jonathan Druart 2018-03-30 19:26:24 UTC
Sounds like a MySQL problem, try to grant privileges to this user.
Comment 2 Rudolf Byker 2019-05-10 10:11:46 UTC
Probably a MySQL problem, yes. What are the contents of your /etc/mysql/koha-common.cnf ?
Comment 3 Katrin Fischer 2020-04-04 23:13:48 UTC
There has been no more information provided by the reporter in a while - moving to RESOLVED for now.