Bug 7428 - koha-create should check for length of instancename
Summary: koha-create should check for length of instancename
Status: RESOLVED DUPLICATE of bug 10205
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Robin Sheat
QA Contact: Ian Walls
Depends on:
Reported: 2012-01-09 19:20 UTC by Magnus Enger
Modified: 2013-05-06 17:24 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2012-01-09 19:20:43 UTC
"MySQL user names can be up to 16 characters long." ( http://dev.mysql.com/doc/refman/5.0/en/user-names.html )

koha-create constructs the mysql username for a new instance by prepending "koha_" to the instancename. If this results in a username that is longer than 16 characters, mysql will give an error. 

koha-create should do one of these: 

- check the length of the provided instancename and exit with an explanatory message if the mysql username will be too long

- truncate the instancename and use the resulting string as the mysql username, making sure to put the right string in koha-conf.xml
Comment 1 MJ Ray (software.coop) 2012-01-12 12:12:49 UTC
I've upgraded this to minor because it seems like a bug rather than an unimplemented feature.

I think the fix to bug 6482 offers a way to mitigate this problem.
Comment 2 Magnus Enger 2012-01-12 15:36:33 UTC
The way I understand bug 6482, it makes it possible to do "koha-create --request-db", change the mysql details in koha-conf.xml and then do "koha-create --populate-db". So it makes it possible to choose a shorter username for mysql if your instancename results in a username that is too long. 

But there is still a problem for "koha-create --create-db" - since that does everything in one fell swoop. 

Question: should special measures for the length of the instancename (as described in the description of this bug) only apply to --create-db, or to --request-db as well? (I don't use --request-db (yet) myself, so I don't really have an opinion).
Comment 3 Tomás Cohen Arazi 2013-05-06 17:24:29 UTC

*** This bug has been marked as a duplicate of bug 10205 ***