I've got a Raspberry Pi configured to run a MySQL database using MariaDB. To ensure that I don't run out of space I want to move the data directory to an external USB hard drive. I followed an online tutorial and at the end ran the command systemctl start mariadb which failed. Upon inspection, I found that line in the log : [Warning] Can't create test file /media/pi/DDE\ externe\ test/mysql-data/raspberrypi.lower-test
I thought it might be a problem with the permissions, so I redid the step of the tutorial where I create the mysql-data directory on the external drive and set its ownership. There I noticed that I couldn't set the owner to user mysql, it would stay as user pi :
pi@raspberrypi:/media/pi/DDE externe test $ ls -la total 8 drwxrwxrwx 1 pi pi 4096 mars 8 08:31 . drwxr-x---+ 3 root root 4096 mars 7 15:01 .. pi@raspberrypi:/media/pi/DDE externe test $ mkdir mysql_data pi@raspberrypi:/media/pi/DDE externe test $ ls -la total 8 drwxrwxrwx 1 pi pi 4096 mars 8 08:32 . drwxr-x---+ 3 root root 4096 mars 7 15:01 .. drwxrwxrwx 1 pi pi 0 mars 8 08:32 mysql_data pi@raspberrypi:/media/pi/DDE externe test $ sudo chown mysql:mysql mysql_data/ pi@raspberrypi:/media/pi/DDE externe test $ ls -la total 8 drwxrwxrwx 1 pi pi 4096 mars 8 08:32 . drwxr-x---+ 3 root root 4096 mars 7 15:01 .. drwxrwxrwx 1 pi pi 0 mars 8 08:32 mysql_data Am I missing something from that chown command ? Or am I making any obvious mistake ?