I've got a raspberry pi 3 and have an external HDD which I have yet to mount but what directory I make depends a little on how best I can move the datadir location.
So at the moment I have the basic install from apt-get install MariaDB and ive added a new user and then also installed phpmyadmin, everything is good.
But I'd like the data to be stored on the external hdd so it doesn't burn up the sd card.
I've read through a few online instructions, all with bad grammar/spelling and older versions of the software. For example they say to edit /etc/MySQL/my.cnf but the .cnf files seem to be different and I'm not 100% which files (or all files) need changing with the datadir and socket edits.
Which .cnf files need to be edited please?
Edit If I add to /etc/MySQL/my.cnf the following [client-server] datadir=/my-new-directory socket=/my-new-directory/MySQL.sock port=3306 socket=/my-new-directory/MySQL.sock
This would then be overwritten by the other .cnf files that are read after.