OS Ubuntu 18.04, laptop, ssd partitioned for two OS (win8 and linux), second drive mounted with permissions. Line from fstab:
UUID={UUID} /media/iam/storage ntfs-3g permissions 0 1
I created dir db/ in root dir of second drive, than do following step by step exactly as desribed. (Try, I mean. All breaks on step 9):
Moving the MySQL data directory Ubuntu 16.04
Got this error
-- Unit mysql.service has begun starting up.
янв 04 14:39:10 thevoid audit[5063]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/usr/sbin/mysqld" pid=5063 comm="a
янв 04 14:39:10 thevoid kernel: audit: type=1400 audit(1546601950.205:134): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name=
янв 04 14:39:10 thevoid mysqld[5064]: mysqld: Can't change dir to '/media/iam/storage/db/mysql/' (OS errno 13 - Permission denied)
янв 04 14:39:10 thevoid mysqld[5064]: 2019-01-04T11:39:10.441016Z 0 [Warning] [MY-010091] [Server] Can't create test file /media/iam/storage/db/mysql/thevoid.lower-test
янв 04 14:39:10 thevoid mysqld[5064]: 2019-01-04T11:39:10.441064Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 5064
янв 04 14:39:10 thevoid mysqld[5064]: 2019-01-04T11:39:10.442897Z 0 [Warning] [MY-010091] [Server] Can't create test file /media/iam/storage/db/mysql/thevoid.lower-test
янв 04 14:39:10 thevoid mysqld[5064]: 2019-01-04T11:39:10.442905Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /media/iam/storage/db/mysql/ is c
янв 04 14:39:10 thevoid mysqld[5064]: 2019-01-04T11:39:10.442937Z 0 [ERROR] [MY-010172] [Server] failed to set datadir to /media/iam/storage/db/mysql/
янв 04 14:39:10 thevoid mysqld[5064]: 2019-01-04T11:39:10.442975Z 0 [ERROR] [MY-010119] [Server] Aborting
янв 04 14:39:10 thevoid mysqld[5064]: 2019-01-04T11:39:10.443075Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL.
янв 04 14:39:10 thevoid systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
янв 04 14:39:10 thevoid systemd[1]: mysql.service: Failed with result 'exit-code'.
янв 04 14:39:10 thevoid systemd[1]: Failed to start MySQL Community Server.
I check permissions for folder mysql, they was 777 with root:root as owner. I change owner:
sudo chown -R mysql:mysql /media/iam/storage/db/mysql
iam@thevoid:/media/iam/storage/db$ ls -la
total 12
drwxrwxrwx 1 mysql mysql 0 янв 4 13:43 .
drwxrwxrwx 1 root root 8192 янв 4 11:30 ..
drwxrwxrwx 1 mysql mysql 4096 янв 4 13:56 mysql
Then
sudo systemctl start mysql
and again got this error. What can I do with this? Why this can happen?