← Back to team overview

maria-discuss team mailing list archive

Re: mysql_install_db as user


Hi, Felipe!

On Nov 12, Felipe Gasper wrote:
> Hello,
> Is this script supposed to be runnable as a normal (i.e., non-root)
> user?
> In MySQL 5.6 there is logic that prevents the chown() of the mysql
> data dir when running as non-root. MariaDB 10.1.8 doesn’t seem to have
> this logic, so the script fails when chown() fails.
> Is this change intended? We have tests that verify functionality of
> user-created, UNIX-socket-only MySQL/MariaDB servers. These work on
> MySQL 5.6 but not on MariaDB 10.1.

There's no special logic around it in MySQL 5.6 and no changes in
MariaDB 10.1.

chown is done if user=xxx is specified on the command line or in the
my.cnf file. And if chown fails, you'll see the error message and
mysql_install_db will abort. Both in MySQL and MariaDB.

What is different, though, in MySQL mysql_install_db will only read
the [mysqld] section in my.cnf, while in MariaDB it will read all
sections that the server will (for me it's: mysqld server mysqld-10.1
mariadb mariadb-10.1 client-server galera). So if one of those sections
in your my.cnf contains "user=mysql", then MariaDB's mysql_install_db
will see it, but MySQL's mysql_install_db won't.

Chief Architect MariaDB
and security@xxxxxxxxxxx

Follow ups