Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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).

share|improve this answer
up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.