WD Community

How can I change the MariaDB data folder

Hello,

I’m trying to change the MariaDB data folder. The default location “/mnt/HD_a4/.@database@” is quite tiny and fills up fast.

Tried adding:

datadir=/mnt/HD/HD_a2/

to the /etc/my.cnf under [mysqld] section and restarted the server, but it didn’t work.

Is there any other configuration file that overwrites the setting? Or am I missing something else?

Any help would be much appreciated.
Thanks.

I stopped Maria DB, moved the /mnt/HD_a4/.@database@ folder to /mnt/HD/HD_a2/ and then created a symbolic link from named /mnt/HD_a4/.@database@ pointing to the actual Maria DB directory structure now located at /mnt/HD/HD_a2/.@database@ then restarted the Maria DB server.

This configuration survives reboots, I would assume will survive firmware updates and there is no need to try change any Maria DB configuration files.

It’s strange why WD configured Maria DB the way they did and put the database on a small partition.

Support for Western Digital Hard Drives | Western Digital

Still Need Help?

Reach out to Support for more assistance.

Sign in to Your Support Account

Get up-to-date information about your products.

Western Digital Business Portal

Unlock benefits and tools for your business such as enterprise support, pricing and rebate tools, marketing, loyalty, rewards, and more.