emerge --config fails for mysql servers in prefix installations. mysql_pkg_config in mysql.eclass is assuming that it is run by root which is not necessarily the case with prefix. Reproducible: Always Steps to Reproduce: 1. emerge mysql 2. run emerge --config as described by the ebuild 3. Actual Results: you'll see lots of error messages and end up with an unusable(?) database. Expected Results: successfull setup of mysql server
Created attachment 249196 [details, diff] patch for the eclass this is a patch for the mysql.eclass. it only touches mysql_pkg_config, though the other parts have some issues as well (e.g. several chowns) the following changes are made: - filter out a useles chown - remove a redundant --user which was already filtered for prefix - set password through mysqladmin instead of mysql client + sql statement - remove a blank line which was a syntax error (and printed the password to the terminal!) - add a --user option for the client when setting the zoneinfo with this patch emerge --config sets up a mysql server i can connect to as user "root"
(In reply to comment #1) > Created an attachment (id=249196) [details] > patch for the eclass > > this is a patch for the mysql.eclass. it only touches mysql_pkg_config, though > the other parts have some issues as well (e.g. several chowns) > > the following changes are made: > - filter out a useles chown fine because you did use prefix || > - remove a redundant --user which was already filtered for prefix Pardon, what does "already filtered" mean? > - set password through mysqladmin instead of mysql client + sql statement Why do you need this? It might be ok but I'd like to see Gentoo Linux use this method too > - remove a blank line which was a syntax error (and printed the password to the > terminal!) huh? I have this fix in my sandbox. Sorry, never made it to svn ci i guess... > - add a --user option for the client when setting the zoneinfo -uroot is suitable for Gentoo Linux too, right? > with this patch emerge --config sets up a mysql server i can connect to as user > "root" >
(In reply to comment #2) > > - remove a redundant --user which was already filtered for prefix > > Pardon, what does "already filtered" mean? --user is set twice, once by an addition to $options and guarded by a 'prefix||' and once to the call itself. i kept the first occurance because it's already prefix-save, that's what i meant by "filtered". > > - set password through mysqladmin instead of mysql client + sql statement > > Why do you need this? It might be ok but I'd like to see Gentoo Linux use this > method too the other method just didn't work, though i don't exactly recall why atm. iirc you can't connect to the mysql server as db-root without a password if you're not os-root. > > - add a --user option for the client when setting the zoneinfo > > -uroot is suitable for Gentoo Linux too, right? i don't know. i don't have a gentoo system at hand for testing...
whew. I just updated mysql.eclass from gx86... http://overlays.gentoo.org/proj/alt/changeset/58810 I want to ask you do to two things, please. 1) Test this eclass since the diff is large. 2) rebase your patch, or confirm that it still applies as desired (did not check) Thanks!
sorry. misfire. Removing mysql-bugs for now. A Gentoo Prefix diff is coming soon :)
Created attachment 252909 [details, diff] patch for the eclass i created the patch relative to this eclass: > # $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.152 2010/10/06 00:13:11 robbat2 Exp $ the changes performed by this patch are: - filter out a useless chown - remove a redundant / erroneous "--user" command line option - set password through mysqladmin instead of mysql client + sql statement the command to set the password itself seems to work in either version, though the following zoneninfo update fails if the password was not set through mysqladmin, so i assume the two methods are not fully equivalent. with the original method from the eclass one will receive this message when loading the zoneinfo: > ERROR 1045: (28000): Access denied for user 'root'@'localhost' (using password: YES) i had to create this patch on another machine without the possibility to test it... please review carefully!
I fixed this in the eclasses now in Prefix tree
landed in gx86