[Bug 6416] New: koha-remove fails when dropping user
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6416 Bug #: 6416 Summary: koha-remove fails when dropping user Classification: Unclassified Change sponsored?: --- Product: Koha Version: rel_3_6 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P5 Component: Packaging AssignedTo: robin@catalyst.net.nz ReportedBy: magnus@enger.priv.no QAContact: koha-bugs@lists.koha-community.org I have MySQL running on the same machine as Apache/Koha, and have created a new library with "sudo koha-create --create-db demo". When i do "sudo koha-remove demo" I get this: Removing Koha instance demo ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_demo'@'%' When I log in to mysql as root and do this: DROP USER failed for 'koha_demo'@'%'; I get pretty much the same message. But when I replace % with localhost and do this: DROP USER failed for 'koha_demo'@'localhost'; it succeeds. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6416 --- Comment #1 from Robin Sheat <robin@catalyst.net.nz> 2011-09-05 04:46:25 UTC --- I've had a confirmation of this. FWIW, the removal line is: DROP USER \`koha_$name\`; There is a comment here: http://dev.mysql.com/doc/refman/5.1/en/drop-user.html saying: As of 5.0.37, if the user does not exists, MySQL responds with: 'ERROR 1396 (HY000): Operation DROP USER failed for ...' There could be funny version things happening. Also: http://dev.mysql.com/doc/refman/5.1/en/account-names.html says that '%' is implied if not there, and is treated as a wildcard, so I'd expect it should work. I may have to do more testing at some stage. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6416 Simon Story <simon.story@catalyst-eu.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simon.story@catalyst-eu.net --- Comment #2 from Simon Story <simon.story@catalyst-eu.net> 2011-11-18 13:57:35 UTC --- The '%' wildcard seems to match when mysql is checking the host the connection is being made, not when matching users to delete. I see in koha-create that 'koha_demo'@'localhost' shouldn't have been created. Since the code is: CREATE USER \`$mysqluser\`@'%' IDENTIFIED BY '$mysqlpwd' Perhaps Magnus you are mistaken as to the course of events? Observe the obtuseness of mysql: mysql> create user mysql_is_erratic; Query OK, 0 rows affected (0.00 sec) mysql> select User,Host from user where User like 'mysql_is_erratic'; +------------------+------+ | User | Host | +------------------+------+ | mysql_is_erratic | % | +------------------+------+ 1 row in set (0.00 sec) mysql> create user 'mysql_is_erratic'@''; Query OK, 0 rows affected (0.00 sec) mysql> create user 'mysql_is_erratic'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> select User,Host from user where User like 'mysql_is_erratic'; +------------------+-----------+ | User | Host | +------------------+-----------+ | mysql_is_erratic | | | mysql_is_erratic | % | | mysql_is_erratic | localhost | +------------------+-----------+ 3 rows in set (0.00 sec) mysql> drop user 'mysql_is_erratic'; Query OK, 0 rows affected (0.00 sec) mysql> select User,Host from user where User like 'mysql_is_erratic'; +------------------+-----------+ | User | Host | +------------------+-----------+ | mysql_is_erratic | | | mysql_is_erratic | localhost | +------------------+-----------+ 2 rows in set (0.00 sec) mysql> drop user 'mysql_is_erratic'@''; Query OK, 0 rows affected (0.00 sec) mysql> drop user 'mysql_is_erratic'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> select User,Host from user where User like 'mysql_is_erratic'; Empty set (0.00 sec) simons@simonskoha:~/src/koha/debian/scripts$ mysql --version mysql Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (x86_64) using readline 6.1 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6416 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |6684 -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6416 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Is this still valid? -- You are receiving this mail because: You are watching all bug changes. You are the QA Contact for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org