mysql_enable="YES" mysql_dbdir="/db/mysql" # mysql_args="--skip-grant-tables \ --skip-networking" # for resetting the root password
$ ps aux /usr/local/libexec/mysqld \ --defaults-extra-file=/db/mysql/my.cnf \ --basedir=/usr/local \ --datadir=/db/mysql
mysql> SHOW VARIABLES LIKE '%datadir%'; +---------------+------------+ | Variable_name | Value | +---------------+------------+ | datadir | /db/mysql/ | +---------------+------------+
How to initialize a new MySQL installation and create new database
Reset/recover MySQL root password in freebsd