Mysql 11 configuration files

Hi,
I installed the mysql-server and client packages from the remote repo. I am trying to change the datadir configuration value but it always uses the default '/var/db/mysql'
I followed the instructions to make changes to '/usr/local/etc/mysql/my.cnf' and '/usr/local/etc/mysql/conf.d'
The datadir value used did not change.
I then defined the value mysql_optfile in /etc/rc.conf. Did not work.
I then did a 'truss service mysql-server start &> truss.out' and it showed the attempts to load the config file from several locations. None of them is '/usr/local/etc/mysql/my.cnf'. It tries :
/etc/my.cnf
/etc/mysql/my.cnf
/usr/local/etc/my.cnf
$(datadir)/my.cnf
And if I try any of these, the rc script complains that I have to merge those files with /usr/local/etc/mysql/conf.d/server.cnf.
I removed the check for the /etc/mysql/my.cnf, the script continued, but started with the default data directory.
So I hardcoded the path to the datadir on therc script and it works.

But I want to configure it from the my.cnf file.´
What do I have to do ?

Thanks,
Regards
 
MySQL 11.0 doesn't exist mate. Anyway, doesn't matter, because they all configure the datadir in a similar same way, by setting mysql_dbdir in rc.conf.

The datadir value used did not change.
From /usr/local/etc/rc.d/mysql (from MariaDB 11.4):
Code:
# Add the following line to /etc/rc.conf to enable mysql:
# mysql_(instance_)?enable (bool):      Set to "NO" by default.
#                       Set it to "YES" to enable MySQL.
# mysql_(instance_)?dbdir (str):        Default to "/var/db/mysql"
#                       Base database directory.
# mysql_(instance_)?args (str): Custom additional arguments to be passed
#                       to mysqld_safe (default empty).
# mysql_(instance_)?pidfile (str): Custom PID file path and name.
#                       Default to "${mysql_dbdir}/${hostname}.pid".
# mysql_(instance_)?user (str): User to run mysqld as
#                       Default to "mysql" created by the port
# mysql_(instance_)?optfile (str): Server-specific option file.
#                       Default to "${mysql_dbdir}/my.cnf".
# mysql_(instance)?rundir (str):        Default to "/var/run/mysql"
# mysql_instances (str): Set to "" by default.
#                       If defined, list of instances to enable
 
Yes, I meant Maria DB11. The configuration files and binaries still have mysql, etc.
I had tried setting the mysql_dbdir in the /etc/rc.conf variable but it did not work. Clearly I must have done something wrong.
I removed the hard-coded value from the rc script that in my case is named mysql-server. Now it is working.
Thanks
Regards
 
Back
Top