How can I change my mysql8 data directory in freebsd ?

Hi all:
How can I change my mysql8 data directory in freebsd ? I want to change mysql default directory.
old directory is SSD /var/db/mysql , The new path is another mount point SAS HD /newdata/mysql

I search google following example, right?

I 1633165871631.pngfind​

 
How can I change my mysql8 data directory in freebsd ?
Set mysql_dbdir in /etc/rc.conf:
Code:
# mysql_enable (bool):	Set to "NO" by default.
#			Set it to "YES" to enable MySQL.
# mysql_dbdir (str):	Default to "/var/db/mysql"
#			Base database directory.
# mysql_confdir (str):	Default to "/usr/local/etc/mysql"
#			Base configuration directory.
# mysql_optfile (str):	Server-specific option file.
#			Set it in the rc.conf or default behaviour of
#			`mysqld_safe` itself, will be picking
#			${mysql_confdir}/my.cnf if it exists.
# mysql_pidfile (str):	Custum PID file path and name.
#			Default to "${mysql_dbdir}/${hostname}.pid".
# mysql_args (str):	Custom additional arguments to be passed
#			to mysqld_safe (default empty).
 
Back
Top