[Koha-bugs] [Bug 22128] New: koha-remove fails mysql ERROR 1133 (42000) at line 2: Can't find any matching row in the user table
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Jan 14 12:48:50 CET 2019
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22128
Bug ID: 22128
Summary: koha-remove fails mysql ERROR 1133 (42000) at line 2:
Can't find any matching row in the user table
Change sponsored?: ---
Product: Koha
Version: 18.05
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: Command-line Utilities
Assignee: koha-bugs at lists.koha-community.org
Reporter: Heinrich.Hartl at email.de
QA Contact: testopia at bugs.koha-community.org
CC: robin at catalyst.net.nz
Target Milestone: ---
The script fails in in a GRANT command - the user does not exist
This probably is due to changed behaviour of mysql 5.7ff
From https://dev.mysql.com/doc/refman/5.7/en/grant.html#grant-overview:
Note
If an account named in a GRANT statement does not already exist, GRANT may
create it under the conditions described later in the discussion of the
NO_AUTO_CREATE_USER SQL mode. It is also possible to use GRANT to specify
nonprivilege account characteristics such as whether it uses secure connections
and limits on access to server resources.
However, use of GRANT to create accounts or define nonprivilege characteristics
is deprecated as of MySQL 5.7.6. Instead, perform these tasks using CREATE USER
or ALTER USER.
In my case mysql hosted a koha 16.11 database upgraded to 18.5 and the only
existing user was koha_library@%. There was no user koha_library at localhost.
mysql was running in the version (> 5.7)supplied with ubuntu 16.4 (Xenial).
My solution to the problem was commenting out two lines in the script.
diff /usr/sbin/koha-remove /usr/sbin/koha-remove_ori
71c71
< # GRANT USAGE ON \`koha_$name\`.* TO \`koha_$name\`@\`$mysql_hostname\`;
---
> GRANT USAGE ON \`koha_$name\`.* TO \`koha_$name\`@\`$mysql_hostname\`;
73c73
< # DROP USER \`koha_$name\`@\`$mysql_hostname\`;
---
> DROP USER \`koha_$name\`@\`$mysql_hostname\`;
hhl at koha-VM-dev:~ >
For a general solution the koha-remove script should be made more resilient and
should not use deprecated mysql features. Since I am only very occasionally
dealing with mysql and moreover I have no knowledge which user(s) have been
used for koha instances in the past it is beyond my skills to define the proper
revision of the script.
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
More information about the Koha-bugs
mailing list