[Bug 14533] New: koha-create --use-db option shouldn't create any db or db user
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14533 Bug ID: 14533 Summary: koha-create --use-db option shouldn't create any db or db user Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: gmcharlt@gmail.com Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz It is counter-intuitive to have an option switch --use-db which tries to create a db (what is --create-db for then?) and also a db user... It is of more use to just pass it the data for using an already created db with its credentials. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14533 Yarik Dot <yarikdot@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yarikdot@gmail.com --- Comment #1 from Yarik Dot <yarikdot@gmail.com> --- Created attachment 41424 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41424&action=edit Patch - remove CREATE USER when koha-create --use-db Please, check the attachment. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14533 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Yarik Dot from comment #1)
Created attachment 41424 [details] [review] Patch - remove CREATE USER when koha-create --use-db
Please, check the attachment.
I think the behaviour should be: - If the user passes DB parameters (user, pass, hostname, dbname), use them to configure the instance. This needs more parameters to be added to koha-create. hostname should default to 'localhost' if ommited. - If some of the new parameters is missing, fallback to what is configured in /etc/koha/passwd. - If some of the relevant parameters is missing, fail loudly. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14533 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Comment on attachment 41424 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41424 Patch - remove CREATE USER when koha-create --use-db - if [ "$op" = use ] - then - mysql --defaults-extra-file=/etc/mysql/koha-common.cnf --force <<eof -CREATE USER \`$mysqluser\`@'$mysql_hostname' IDENTIFIED BY '$mysqlpwd'; -CREATE USER \`$mysqluser\`@'%' IDENTIFIED BY '$mysqlpwd'; -GRANT ALL PRIVILEGES ON \`$mysqldb\`.* TO \`$mysqluser\`; -FLUSH PRIVILEGES; -eof - fi #` - This is not enough, as the DB is still being created. Look at my previous comment -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14533 --- Comment #4 from Yarik Dot <yarikdot@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #2)
I think the behaviour should be:
- If the user passes DB parameters (user, pass, hostname, dbname), use them to configure the instance. This needs more parameters to be added to koha-create. hostname should default to 'localhost' if ommited.
There is currently /etc/mysql/koha-common.cnf used right? Why to change this behavior? If there is nothing defined in here, default client configuration from /etc/mysql/my.cnf is used. Anyway, I am ok with changing this behaviour if the change is consistent. That means, there won't be 10 places where the database connection can be defined.
- If some of the new parameters is missing, fallback to what is configured in /etc/koha/passwd.
Why? That is why passwdfile is used, isn't it?
- If some of the relevant parameters is missing, fail loudly.
Agree. ------- To explain more how we use it: first# koha-create --request-db mysql# mysql; CREATE DB ...; GRANT ...; first# koha-create --populate-db second# koha-create --use-db --passwdfile ./file (In reply to Tomás Cohen Arazi from comment #3)
This is not enough, as the DB is still being created. Look at my previous comment
I have just double checked the koha-create script and database is only created when --create is used. It is on line 560 and nowhere else. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org