I tried to run quibble but ran into several errors during database initialization. Environment: Ubuntu 17.10 Artful, mysqld Ver 5.7.21-0ubuntu0.17.10.1, PHP 7.1.15-0ubuntu0.17.10.1
First, the mysql_install_db command complains that it is deprecated and we should “consider switching to mysqld --initialize”, and then it can’t find the mysqld binary. strace reveals that it only checks ./mysqld, ./bin/mysqld, /usr/bin/mysqld, /usr/local/bin/mysqld, /opt/mysql/bin/mysqld, /opt/mysql/server-5.7/sbin/mysqld, and /opt/mysql/server-5.7/bin/mysqld, but not /usr/sbin/mysqld where the binary actually resides, even though according to the manpage /usr/sbin/ is one of the “last resort” paths where it should look for mysqld.
But let’s take mysql_install_db’s advice and use mysqld --initialize instead:
diff --git a/quibble/backend.py b/quibble/backend.py index 1f013b8..abb4345 100644 --- a/quibble/backend.py +++ b/quibble/backend.py @@ -109,7 +109,8 @@ class MySQL(BackendServer): def _install_db(self): self.log.info('Initializing MySQL data directory') p = subprocess.Popen([ - 'mysql_install_db', + 'mysqld', + '--initialize', '--datadir=%s' % self.rootdir, '--user=%s' % pwd.getpwuid(os.getuid())[0], ],
But then the next problem happens – mysqld doesn’t have permission to open /var/log/mysql/error.log. And if I specify a different error log location in the command line, some other part will fail, because mysql reads the whole config in /etc/mysql/, which just isn’t tailored at all for running a different mysqld than the system service… and I’m not sure how to overcome that. (The same problem occurs if we add --mysqld-file=/usr/sbin/mysqld to mysql_install_db, by the way.)
@hashar I’m curious why you don’t get the same problem… what kind of system did you test this on? Do you have a better-suited /etc/mysql/ configuration? Is this distribution-dependent?
(And just in case I massively misunderstood something… running quibble outside of sudo and without a container is supposed to work, right? Otherwise this whole task is just inconsequential noise, sorry :) )