1

New install of mariadb-server 5.5.38 on FreeBSD 10.0-RELEASE-p5 amd64 refuses to start.

Currently refusing to start for this reason:

140808 14:12:28 [ERROR] mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
140808 14:12:28 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
140808 14:12:28 [Note] Server socket created on IP: '::'.
140808 14:12:28 [ERROR] mysqld: Can't find file: './mysql/host.frm' (errno: 13)
140808 14:12:28 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
140808 14:12:28 mysqld_safe mysqld from pid file /var/db/mysql/milicent.ericx.net.pid ended

And, of course, the referenced mysql_upgrade refuses to run because the server is not running (so I'm ignoring the plugin.frm error for the time being).

Everything I can find suggests that host.frm should be created first-start in the datadir. Obviously mysqld understands that datadir=./mysql. This in spite of the fact that /usr/local/etc/my.cnf specifies datadir:

[mysqld]
    datadir=/var/db/mysql

AND I'm specifying datadir=/var/db/mysql on the command line as well.

/var/db/mysql is owned by mysql:mysql and has permissions 750 as confirmed by the fact that mysqld has happily created the subdirectories mysql and test.

How else might the path to host.frm be specified?

Can I make the file by hand? (i.e. is it a text file?)

Running mysql_install_db --user mysql --datadir /var/db/mysql fails with the same error.

--update: I've even tried starting the server from the /var/db directory to obviate the relative path ./mysql; but that still fails. So the relative path starting point is something other than the directory where the program is run.

2 Answers 2

1

Everything I can find suggests that host.frm should be created first-start in the datadir.

Whatever suggested that to you is flat out wrong. The system tables are created when you run mysql_install_db.

MariaDB official docs: Installing system tables (mysql_install_db).

1

In order for mysql_install_db to run for 5.5.38 on FreeBSD 10.0-RELEASE-p5 amd64 you have to supply: user, datadir and basedir. After mysql_install_db is finished, mysqld will find base and data directories without assistance. e.g.:

mysql_install_db  --user=mysql --basedir=/usr/local --datadir=/var/db/mysql

Please also note that the = chars for the parameters are required; but there is no error message if they are forgotten.

3
  • Results in segfault on FreeBSD 11.2 with mariadb103-server (10.3.7) ...
    – user441987
    Aug 2, 2018 at 16:14
  • @Code4R7 hm.. segfault is a different sort of problem. The binary is actually crashing; so out of date libraries? exotic compiler options? Perhaps contact the port maintainer. 11.2 is still a little new.
    – ericx
    Aug 3, 2018 at 15:21
  • I tried to install 10.3.7 via pkg, but eventually I managed to install 10.3.8 via ports.
    – user441987
    Aug 3, 2018 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .