Hi, I installed dev-db/percona-server-5.6.17.65.0 from the mysql-overlay, replaced "/etc/mysql/my.cnf" with my custom configuration which includes # SAFETY # max-allowed-packet = 16M max-connect-errors = 1000000 skip-name-resolve skip-show-database sql-mode = STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY sysdate-is-now = 1 innodb = FORCE innodb-strict-mode = 1 # DATA STORAGE # datadir = /srv/mysql/data/ When I now run "emerge --config percona-server" the mysql_install_db script will fail: Configuring pkg... * MySQL MY_DATADIR has changed * from /var/lib/mysql * to /srv/mysql/data/ * Previous MY_DATADIR (///var/lib/mysql) does not exist * Attempting to use ///srv/mysql/data * Please provide a password for the mysql 'root' user now, in the * MYSQL_ROOT_PASSWORD env var or through the /root/.my.cnf file. * Avoid ["'\_%] characters in the password > * Retype the password > * Creating the mysql database and setting proper * permissions on it ... * Command: strace -s 4096 -f -o /tmp/strace.log '/usr/share/mysql/scripts/mysql_install_db' '--basedir=/usr' --log-war$ ings=0 --loose-skip-grant-tables --loose-skip-host-cache --loose-skip-name-resolve --loose-skip-networking --loose-skip$ slave-start --loose-skip-ssl --loose-skip-log-bin --loose-skip-relay-log --loose-skip-slow-query-log --loose-skip-exter$ al-locking --loose-skip-log-slave-updates --user=mysql '--datadir=///srv/mysql/data/' * ERROR: dev-db/percona-server-5.6.17.65.0 failed (config phase): * Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/percona-server-5.6.17.65.0/temp/mysql_install_db.log * * Call stack: * ebuild.sh, line 93: Called pkg_config * environment, line 3672: Called mysql-v2_pkg_config * environment, line 3267: Called die * The specific snippet of code: * die "Failed to run mysql_install_db. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql$ install_db.log"; This problem was hard to debug, because the mentioned log files didn't contain an error. After adding "strace" before the $cmd in /var/db/pkg/dev-db/percona-server/environment.bz2 I saw 6405 write(2, "2014-05-19 01:26:28 6405 [Note] InnoDB: Using Linux native AIO\n", 63) = 63 6405 brk(0x293000000) = 0x293000000 6405 write(2, "2014-05-19 01:26:28 6405 [Note] InnoDB: Using CPU crc32 instructions\n", 69) = 69 6405 open("/var/tmp/portage/dev-db/percona-server-5.6.17.65.0/temp/ibkRohS1", O_RDWR|O_CREAT|O_EXCL, 0600) = -1 EACCES (Permission denied) 6405 write(2, "\7", 1) = 1 6405 write(2, "/usr/sbin/mysqld", 16) = 16 6405 write(2, ": ", 2) = 2 6405 write(2, "Can't create/write to file '/var/tmp/portage/dev-db/percona-server-5.6.17.65.0/temp/ibkRohS1' (Errcode: 13 - Permission denied)", 127) = 127 6405 write(2, "\n", 1) = 1 6405 write(2, "2014-05-19 01:26:28 7f3ce1e16780", 32) = 32 6405 write(2, " InnoDB: Error: unable to create temporary file; errno: 13\n", 60) = 60 6405 write(2, "2014-05-19 01:26:28 6405 [ERROR] Plugin 'InnoDB' init function returned error.\n", 79) = 79 6405 write(2, "2014-05-19 01:26:28 6405 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.\n", 90) = 90 6405 write(2, "2014-05-19 01:26:28 6405 [ERROR] Failed to initialize plugins.\n", 63) = 63 6405 write(2, "2014-05-19 01:26:28 6405 [ERROR] Aborting\n\n", 43) = 43 Then I remembered that I set "innodb=FORCE" in my my.cnf... after removing this line "emerge --config" was successful. Maybe we can improve the following things: 1) Workaround "innodb=FORCE" when set in my.cnf 2) The error was logged in "/var/log/mysql/mysql-error.log", not in the mentioned log file. Maybe we can parse the log-error variable to tell the user the right log file or make the error message more general "Please review your mysql error log"? I was using percona-server but I guess I'll see the same error with mariadb. Reproducible: Always
*** This bug has been marked as a duplicate of bug 510720 ***