Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 246106

Summary: dev-db/mysql-5.0.60-r1 -- emerge --config fails if not using default datadir
Product: Gentoo Linux Reporter: Daniel Santos <daniel.santos>
Component: New packagesAssignee: Gentoo Linux MySQL bugs team <mysql-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: 2008.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Daniel Santos 2008-11-08 22:53:49 UTC
I'm using fhs, so prefer my data under /svr (it's own device).  If you install mysql, edit /etc/mysql/my.cnf and change "datadir" to something other than /var/lib/mysql (/svr/mysql in my case) then the emerge --config script fails.  

emerge --config =dev-db/mysql-5.0.60-r1


Configuring pkg...

 * Creating the mysql database and setting proper
 * permissions on it ...
 * Insert a password for the mysql 'root' user
 * Avoid ["'\_%] characters in the password
    >
 * Retype the password
    >
 *
 * ERROR: dev-db/mysql-5.0.60-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called pkg_config
 *             environment, line 3360:  Called mysql_pkg_config
 *             environment, line 3063:  Called die
 * The specific snippet of code:
 *       [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] || die "MySQL databases not installed";
 *  The die message:
 *   MySQL databases not installed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/log/portage/dev-db:mysql-5.0.60-r1:20081108-222211.log'.
 * The ebuild environment file is located at '/tmp/portage/dev-db/mysql-5.0.60-r1/temp/environment'.
 * This ebuild is from an overlay: '/var/db/pkg/'
 *


I stuck a "set -x" in the environment file and re-ran it (with FEATURES=noauto ebuild ...etc... --config) and confirmed that it was trying to use /var/lib/mysql instead of /svr/mysql.

+ [[ -f ///var/lib/mysql/mysql/user.frm ]]
+ die 'MySQL databases not installed'

My database had actually be created under /svr/mysql as it should have, but it failed at this point.  I haven't dug into the eclass/ebuild for this, but I suspect it presumes /var/lib/mysql rather than looking at /etc/mysql/my.conf as it would seem it should.


Portage 2.1.4.5 (hardened/amd64/multilib, gcc-3.4.6, glibc-2.6.1-r0, 2.6.23-hardened-r5 x86_64)
=================================================================
System uname: 2.6.23-hardened-r5 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
Timestamp of tree: Sat, 08 Nov 2008 18:45:03 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r7
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -msse3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openjms/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O2 -msse3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg distlocks installsources metadata-transfer parallel-fetch sandbox sfperms splitdebug strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://mirrors.cs.wmich.edu/gentoo http://mirror.mcs.anl.gov/pub/gentoo/ http://osmirrors.cerias.purdue.edu/pub/gentoo/"
LANG="en_US"
LINGUAS="en_US af ar as_IN be be_BY bg br bs ca cs csb cy da de dz el en en_GB en_ZA es es_AR es_ES et eu fa fi fr fy fy_NL ga ga_IE gl gu gu_IN he hi hi_IN hr hu is it ja ka km ko ku lt mk ml_IN mn mr_IN ms mt nb nb_NO nds ne nl nn nn_NO nr ns or_IN pa pa_IN pl pt pt_BR pt_PT ro ru rw sh sk sl sr ss st sv sv_SE sw sw_TZ ta te te_IN tg th ti ti_ER tr ts uk ur ur_IN ve vi xh zh zh_CN zh_TW zu"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 64bit 7zip acl amd64 apache2 authdaemond bash-completion berkdb bzip2 caps cdr cgi cjk commons-digester cpufreq cracklib crypt cscope curl doc double-precis double-precision dvd dvdr enscript examples exif fam fasttrack fbcon fftw fontconfig fortran ftp gcj gd gdb gdbm gif ginac git gmp gmtfull gnutls gpm graphviz gs hardened hddtemp highlight html iconv id3 imagemagick imap imlib inifile jadetex java javamail javascript jbig jce jms jmx jpeg jpeg2k justify kerberos latex ldap libwww lm_sensors log4j lua lzo maildir math mbox md5sum midi mime ming mmap mmkeys mng modperl modplug mouse mp3 mpeg mudflap multicall multilib multislot mysql mysqli ncurses nls nntp nptl nptlonly nspluginobjc objc++ objc-gc openexr openmp openssl pam pango pcre pdf perl php pic plotutils png pop posix posixpython python rar readline rrdcgi rtc ruby sasl savedconfig sdl sensord servletapi session sharedmem smtp snmp soap sockets source spell spl sqlite sqlite3 sse sse2 sse3 ssl startup-notification stream subversion svg svgz sysfs syslog sysvipc tcl tcpd threads tidy tiff tk tokenizer truetype unicode urandom usb vdats vhosts vim-syntax vorbis webdav wifi wmf xattr xcb xface xforms xinetd xml xmlreader xmlrpc xmlwriter xorg xpm xprint xsl yv12 zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias asis auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config log_forensic logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http rewrite setenvif so speling status substitute unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="mouse keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US af ar as_IN be be_BY bg br bs ca cs csb cy da de dz el en en_GB en_ZA es es_AR es_ES et eu fa fi fr fy fy_NL ga ga_IE gl gu gu_IN he hi hi_IN hr hu is it ja ka km ko ku lt mk ml_IN mn mr_IN ms mt nb nb_NO nds ne nl nn nn_NO nr ns or_IN pa pa_IN pl pt pt_BR pt_PT ro ru rw sh sk sl sr ss st sv sv_SE sw sw_TZ ta te te_IN tg th ti ti_ER tr ts uk ur ur_IN ve vi xh zh zh_CN zh_TW zu" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i810 intel mach64 mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Daniel Santos 2008-11-08 22:57:55 UTC
oops, I already deleted environment file.  Please let me know if you need it and I'll generate a new one (will have to bring down mysql and hack up my system to do it)
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-11-10 02:10:16 UTC
/var/lib/mysql is not hardcoded in the ebuild/eclass.
If you read mysql_pkg_config and mysql_init_vars, you'll see that it fetches the datadir from your configuration.

Further up in your output, I need the output from line:
elog "MySQL MY_DATADIR is ${MY_DATADIR}"

If that doesn't reflect your custom datadir, then you need to update my.cnf so it does.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-11-14 06:32:25 UTC

*** This bug has been marked as a duplicate of bug 212407 ***
Comment 4 Daniel Santos 2008-11-14 10:28:17 UTC
Sorry, I'm not sure how I missed the original bug in my search :(