Hi,
I have installed the Mariadb 10.3 to FreeBSD 11.3, it works well, I would like to change the database directory from the default location (/var/db/mysql) to other location, but it does not work...
I have done below:
- copy /var/db/mysql to the target directory
- rename the /var/db/mysql to /var/db/mysql.bak
- add below to /etc/rc.conf to ensure the proper my.cnf is used:
- edit my.cnf to add the datadir = the target directory
However, it does not work, it could not use the database on the target directory. When Mariadb is restarted, it would create the mysql database files in /var/db/mysql
any idea?
Many thanks
I have installed the Mariadb 10.3 to FreeBSD 11.3, it works well, I would like to change the database directory from the default location (/var/db/mysql) to other location, but it does not work...
I have done below:
- copy /var/db/mysql to the target directory
- rename the /var/db/mysql to /var/db/mysql.bak
- add below to /etc/rc.conf to ensure the proper my.cnf is used:
Code:
mysql_optfile="/usr/local/etc/my.cnf"
- edit my.cnf to add the datadir = the target directory
However, it does not work, it could not use the database on the target directory. When Mariadb is restarted, it would create the mysql database files in /var/db/mysql
any idea?
Many thanks