Bug 7428

Summary: koha-create should check for length of instancename
Product: Koha Reporter: Magnus Enger <magnus>
Component: PackagingAssignee: Robin Sheat <robin>
Status: RESOLVED DUPLICATE QA Contact: Ian Walls <koha.sekjal>
Severity: minor    
Priority: P5 - low CC: mjr, tomascohen
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 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 ***