Mysql

Mariadb 無法啟動(無法更改目錄,錯誤程式碼 13:權限被拒絕)

  • May 6, 2019

我將 MariaDB 數據庫移至/media/user/extdrive1/mysql,更新了 conf 文件,並將chown使用者 mysql.mysql 的驅動器更改為 7777。儘管如此,sudo systemctl start mysqld還是失敗了,如果我檢查系統日誌,它會返回錯誤程式碼 13: Permission Denied to /media/user/extdrive1/mysql

不確定還有什麼可以嘗試的;apparmor mysql 文件為空。

編輯(權限):

/media/user/extdrive1/mysql:
total 110628
drwsrwsrwx 4 mysql mysql     4096 May  2 20:51 .
drwsrwsrwt 4 mysql mysql     4096 May  2 00:15 ..
-rwxrwxrwx 1 mysql mysql    16384 May  2 00:40 aria_log.00000001
-rwxrwxrwx 1 mysql mysql       52 May  2 00:40 aria_log_control
-rwxrwxrwx 1 mysql mysql        0 May  2 00:40 debian-10.1.flag
-rwxrwxrwx 1 mysql mysql 12582912 May  2 20:51 ibdata1
-rwxrwxrwx 1 mysql mysql 50331648 May  2 20:51 ib_logfile0
-rwxrwxrwx 1 mysql mysql 50331648 May  2 00:40 ib_logfile1
-rwxrwxrwx 1 mysql mysql        0 May  2 00:40 multi-master.info
drwsrwsrwx 2 mysql mysql     4096 May  2 00:40 mysql
srwxrwxrwx 1 mysql mysql        0 May  2 00:40 mysql.sock
drwsrwsrwx 2 mysql mysql     4096 May  2 00:40 performance_schema

/media/user/extdrive1/mysql/mysql:
total 1096
drwsrwsrwx 2 mysql mysql   4096 May  2 00:40 .
drwsrwsrwx 4 mysql mysql   4096 May  2 20:51 ..
-rwxrwxrwx 1 mysql mysql   2110 May  2 00:40 columns_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 columns_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 columns_priv.MYI
-rwxrwxrwx 1 mysql mysql   2602 May  2 00:40 column_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 column_stats.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 column_stats.MYI
-rwxrwxrwx 1 mysql mysql   2677 May  2 00:40 db.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 db.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 db.MYI
-rwxrwxrwx 1 mysql mysql   3683 May  2 00:40 event.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 event.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 event.MYI
-rwxrwxrwx 1 mysql mysql   1582 May  2 00:40 func.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 func.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 func.MYI
-rwxrwxrwx 1 mysql mysql     35 May  2 00:40 general_log.CSM
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 general_log.CSV
-rwxrwxrwx 1 mysql mysql    804 May  2 00:40 general_log.frm
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 gtid_slave_pos.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 gtid_slave_pos.ibd
-rwxrwxrwx 1 mysql mysql   1706 May  2 00:40 help_category.frm
-rwxrwxrwx 1 mysql mysql   1092 May  2 00:40 help_category.MYD
-rwxrwxrwx 1 mysql mysql   3072 May  2 00:40 help_category.MYI
-rwxrwxrwx 1 mysql mysql   1638 May  2 00:40 help_keyword.frm
-rwxrwxrwx 1 mysql mysql  91408 May  2 00:40 help_keyword.MYD
-rwxrwxrwx 1 mysql mysql  16384 May  2 00:40 help_keyword.MYI
-rwxrwxrwx 1 mysql mysql    970 May  2 00:40 help_relation.frm
-rwxrwxrwx 1 mysql mysql   9252 May  2 00:40 help_relation.MYD
-rwxrwxrwx 1 mysql mysql  19456 May  2 00:40 help_relation.MYI
-rwxrwxrwx 1 mysql mysql   1776 May  2 00:40 help_topic.frm
-rwxrwxrwx 1 mysql mysql 405476 May  2 00:40 help_topic.MYD
-rwxrwxrwx 1 mysql mysql  20480 May  2 00:40 help_topic.MYI
-rwxrwxrwx 1 mysql mysql   1897 May  2 00:40 host.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 host.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 host.MYI
-rwxrwxrwx 1 mysql mysql   1629 May  2 00:40 index_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 index_stats.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 index_stats.MYI
-rwxrwxrwx 1 mysql mysql   4998 May  2 00:40 innodb_index_stats.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 innodb_index_stats.ibd
-rwxrwxrwx 1 mysql mysql   1503 May  2 00:40 innodb_table_stats.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 innodb_table_stats.ibd
-rwxrwxrwx 1 mysql mysql   1518 May  2 00:40 plugin.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 plugin.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 plugin.MYI
-rwxrwxrwx 1 mysql mysql   3418 May  2 00:40 proc.frm
-rwxrwxrwx 1 mysql mysql   1144 May  2 00:40 proc.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 proc.MYI
-rwxrwxrwx 1 mysql mysql   2874 May  2 00:40 procs_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 procs_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 procs_priv.MYI
-rwxrwxrwx 1 mysql mysql   2839 May  2 00:40 proxies_priv.frm
-rwxrwxrwx 1 mysql mysql   1269 May  2 00:40 proxies_priv.MYD
-rwxrwxrwx 1 mysql mysql  10240 May  2 00:40 proxies_priv.MYI
-rwxrwxrwx 1 mysql mysql   1661 May  2 00:40 roles_mapping.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 roles_mapping.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 roles_mapping.MYI
-rwxrwxrwx 1 mysql mysql   2703 May  2 00:40 servers.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 servers.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 servers.MYI
-rwxrwxrwx 1 mysql mysql     35 May  2 00:40 slow_log.CSM
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 slow_log.CSV
-rwxrwxrwx 1 mysql mysql   2374 May  2 00:40 slow_log.frm
-rwxrwxrwx 1 mysql mysql   2957 May  2 00:40 tables_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 tables_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 tables_priv.MYI
-rwxrwxrwx 1 mysql mysql   1374 May  2 00:40 table_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 table_stats.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 table_stats.MYI
-rwxrwxrwx 1 mysql mysql    973 May  2 00:40 time_zone.frm
-rwxrwxrwx 1 mysql mysql    971 May  2 00:40 time_zone_leap_second.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_leap_second.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_leap_second.MYI
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone.MYI
-rwxrwxrwx 1 mysql mysql   1146 May  2 00:40 time_zone_name.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_name.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_name.MYI
-rwxrwxrwx 1 mysql mysql   1013 May  2 00:40 time_zone_transition.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_transition.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_transition.MYI
-rwxrwxrwx 1 mysql mysql   1079 May  2 00:40 time_zone_transition_type.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_transition_type.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_transition_type.MYI
-rwxrwxrwx 1 mysql mysql   3191 May  2 00:40 user.frm
-rwxrwxrwx 1 mysql mysql    176 May  2 00:40 user.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 user.MYI

/media/user/extdrive1/mysql/performance_schema:
total 12
drwsrwsrwx 2 mysql mysql 4096 May  2 00:40 .
drwsrwsrwx 4 mysql mysql 4096 May  2 20:51 ..
-rwxrwxrwx 1 mysql mysql   61 May  2 00:40 db.opt

/media/user/extdrive1/mysql/:
total 110628
drwsrwsrwx 4 mysql mysql     4096 May  2 20:51 .
drwsrwsrwt 4 mysql mysql     4096 May  2 00:15 ..
-rwxrwxrwx 1 mysql mysql    16384 May  2 00:40 aria_log.00000001
-rwxrwxrwx 1 mysql mysql       52 May  2 00:40 aria_log_control
-rwxrwxrwx 1 mysql mysql        0 May  2 00:40 debian-10.1.flag
-rwxrwxrwx 1 mysql mysql 12582912 May  2 20:51 ibdata1
-rwxrwxrwx 1 mysql mysql 50331648 May  2 20:51 ib_logfile0
-rwxrwxrwx 1 mysql mysql 50331648 May  2 00:40 ib_logfile1
-rwxrwxrwx 1 mysql mysql        0 May  2 00:40 multi-master.info
drwsrwsrwx 2 mysql mysql     4096 May  2 00:40 mysql
srwxrwxrwx 1 mysql mysql        0 May  2 00:40 mysql.sock
drwsrwsrwx 2 mysql mysql     4096 May  2 00:40 performance_schema

/media/user/extdrive1/mysql/mysql:
total 1096
drwsrwsrwx 2 mysql mysql   4096 May  2 00:40 .
drwsrwsrwx 4 mysql mysql   4096 May  2 20:51 ..
-rwxrwxrwx 1 mysql mysql   2110 May  2 00:40 columns_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 columns_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 columns_priv.MYI
-rwxrwxrwx 1 mysql mysql   2602 May  2 00:40 column_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 column_stats.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 column_stats.MYI
-rwxrwxrwx 1 mysql mysql   2677 May  2 00:40 db.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 db.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 db.MYI
-rwxrwxrwx 1 mysql mysql   3683 May  2 00:40 event.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 event.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 event.MYI
-rwxrwxrwx 1 mysql mysql   1582 May  2 00:40 func.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 func.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 func.MYI
-rwxrwxrwx 1 mysql mysql     35 May  2 00:40 general_log.CSM
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 general_log.CSV
-rwxrwxrwx 1 mysql mysql    804 May  2 00:40 general_log.frm
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 gtid_slave_pos.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 gtid_slave_pos.ibd
-rwxrwxrwx 1 mysql mysql   1706 May  2 00:40 help_category.frm
-rwxrwxrwx 1 mysql mysql   1092 May  2 00:40 help_category.MYD
-rwxrwxrwx 1 mysql mysql   3072 May  2 00:40 help_category.MYI
-rwxrwxrwx 1 mysql mysql   1638 May  2 00:40 help_keyword.frm
-rwxrwxrwx 1 mysql mysql  91408 May  2 00:40 help_keyword.MYD
-rwxrwxrwx 1 mysql mysql  16384 May  2 00:40 help_keyword.MYI
-rwxrwxrwx 1 mysql mysql    970 May  2 00:40 help_relation.frm
-rwxrwxrwx 1 mysql mysql   9252 May  2 00:40 help_relation.MYD
-rwxrwxrwx 1 mysql mysql  19456 May  2 00:40 help_relation.MYI
-rwxrwxrwx 1 mysql mysql   1776 May  2 00:40 help_topic.frm
-rwxrwxrwx 1 mysql mysql 405476 May  2 00:40 help_topic.MYD
-rwxrwxrwx 1 mysql mysql  20480 May  2 00:40 help_topic.MYI
-rwxrwxrwx 1 mysql mysql   1897 May  2 00:40 host.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 host.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 host.MYI
-rwxrwxrwx 1 mysql mysql   1629 May  2 00:40 index_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 index_stats.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 index_stats.MYI
-rwxrwxrwx 1 mysql mysql   4998 May  2 00:40 innodb_index_stats.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 innodb_index_stats.ibd
-rwxrwxrwx 1 mysql mysql   1503 May  2 00:40 innodb_table_stats.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 innodb_table_stats.ibd
-rwxrwxrwx 1 mysql mysql   1518 May  2 00:40 plugin.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 plugin.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 plugin.MYI
-rwxrwxrwx 1 mysql mysql   3418 May  2 00:40 proc.frm
-rwxrwxrwx 1 mysql mysql   1144 May  2 00:40 proc.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 proc.MYI
-rwxrwxrwx 1 mysql mysql   2874 May  2 00:40 procs_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 procs_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 procs_priv.MYI
-rwxrwxrwx 1 mysql mysql   2839 May  2 00:40 proxies_priv.frm
-rwxrwxrwx 1 mysql mysql   1269 May  2 00:40 proxies_priv.MYD
-rwxrwxrwx 1 mysql mysql  10240 May  2 00:40 proxies_priv.MYI
-rwxrwxrwx 1 mysql mysql   1661 May  2 00:40 roles_mapping.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 roles_mapping.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 roles_mapping.MYI
-rwxrwxrwx 1 mysql mysql   2703 May  2 00:40 servers.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 servers.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 servers.MYI
-rwxrwxrwx 1 mysql mysql     35 May  2 00:40 slow_log.CSM
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 slow_log.CSV
-rwxrwxrwx 1 mysql mysql   2374 May  2 00:40 slow_log.frm
-rwxrwxrwx 1 mysql mysql   2957 May  2 00:40 tables_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 tables_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 tables_priv.MYI
-rwxrwxrwx 1 mysql mysql   1374 May  2 00:40 table_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 table_stats.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 table_stats.MYI
-rwxrwxrwx 1 mysql mysql    973 May  2 00:40 time_zone.frm
-rwxrwxrwx 1 mysql mysql    971 May  2 00:40 time_zone_leap_second.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_leap_second.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_leap_second.MYI
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone.MYI
-rwxrwxrwx 1 mysql mysql   1146 May  2 00:40 time_zone_name.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_name.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_name.MYI
-rwxrwxrwx 1 mysql mysql   1013 May  2 00:40 time_zone_transition.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_transition.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_transition.MYI
-rwxrwxrwx 1 mysql mysql   1079 May  2 00:40 time_zone_transition_type.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_transition_type.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_transition_type.MYI
-rwxrwxrwx 1 mysql mysql   3191 May  2 00:40 user.frm
-rwxrwxrwx 1 mysql mysql    176 May  2 00:40 user.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 user.MYI

/media/user/extdrive1/mysql/performance_schema:
total 12
drwsrwsrwx 2 mysql mysql 4096 May  2 00:40 .
drwsrwsrwx 4 mysql mysql 4096 May  2 20:51 ..
-rwxrwxrwx 1 mysql mysql   61 May  2 00:40 db.opt

mysql:
total 110628
drwsrwsrwx 4 mysql mysql     4096 May  2 20:51 .
drwsrwsrwt 4 mysql mysql     4096 May  2 00:15 ..
-rwxrwxrwx 1 mysql mysql    16384 May  2 00:40 aria_log.00000001
-rwxrwxrwx 1 mysql mysql       52 May  2 00:40 aria_log_control
-rwxrwxrwx 1 mysql mysql        0 May  2 00:40 debian-10.1.flag
-rwxrwxrwx 1 mysql mysql 12582912 May  2 20:51 ibdata1
-rwxrwxrwx 1 mysql mysql 50331648 May  2 20:51 ib_logfile0
-rwxrwxrwx 1 mysql mysql 50331648 May  2 00:40 ib_logfile1
-rwxrwxrwx 1 mysql mysql        0 May  2 00:40 multi-master.info
drwsrwsrwx 2 mysql mysql     4096 May  2 00:40 mysql
srwxrwxrwx 1 mysql mysql        0 May  2 00:40 mysql.sock
drwsrwsrwx 2 mysql mysql     4096 May  2 00:40 performance_schema

mysql/mysql:
total 1096
drwsrwsrwx 2 mysql mysql   4096 May  2 00:40 .
drwsrwsrwx 4 mysql mysql   4096 May  2 20:51 ..
-rwxrwxrwx 1 mysql mysql   2110 May  2 00:40 columns_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 columns_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 columns_priv.MYI
-rwxrwxrwx 1 mysql mysql   2602 May  2 00:40 column_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 column_stats.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 column_stats.MYI
-rwxrwxrwx 1 mysql mysql   2677 May  2 00:40 db.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 db.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 db.MYI
-rwxrwxrwx 1 mysql mysql   3683 May  2 00:40 event.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 event.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 event.MYI
-rwxrwxrwx 1 mysql mysql   1582 May  2 00:40 func.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 func.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 func.MYI
-rwxrwxrwx 1 mysql mysql     35 May  2 00:40 general_log.CSM
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 general_log.CSV
-rwxrwxrwx 1 mysql mysql    804 May  2 00:40 general_log.frm
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 gtid_slave_pos.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 gtid_slave_pos.ibd
-rwxrwxrwx 1 mysql mysql   1706 May  2 00:40 help_category.frm
-rwxrwxrwx 1 mysql mysql   1092 May  2 00:40 help_category.MYD
-rwxrwxrwx 1 mysql mysql   3072 May  2 00:40 help_category.MYI
-rwxrwxrwx 1 mysql mysql   1638 May  2 00:40 help_keyword.frm
-rwxrwxrwx 1 mysql mysql  91408 May  2 00:40 help_keyword.MYD
-rwxrwxrwx 1 mysql mysql  16384 May  2 00:40 help_keyword.MYI
-rwxrwxrwx 1 mysql mysql    970 May  2 00:40 help_relation.frm
-rwxrwxrwx 1 mysql mysql   9252 May  2 00:40 help_relation.MYD
-rwxrwxrwx 1 mysql mysql  19456 May  2 00:40 help_relation.MYI
-rwxrwxrwx 1 mysql mysql   1776 May  2 00:40 help_topic.frm
-rwxrwxrwx 1 mysql mysql 405476 May  2 00:40 help_topic.MYD
-rwxrwxrwx 1 mysql mysql  20480 May  2 00:40 help_topic.MYI
-rwxrwxrwx 1 mysql mysql   1897 May  2 00:40 host.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 host.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 host.MYI
-rwxrwxrwx 1 mysql mysql   1629 May  2 00:40 index_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 index_stats.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 index_stats.MYI
-rwxrwxrwx 1 mysql mysql   4998 May  2 00:40 innodb_index_stats.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 innodb_index_stats.ibd
-rwxrwxrwx 1 mysql mysql   1503 May  2 00:40 innodb_table_stats.frm
-rwxrwxrwx 1 mysql mysql  98304 May  2 00:40 innodb_table_stats.ibd
-rwxrwxrwx 1 mysql mysql   1518 May  2 00:40 plugin.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 plugin.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 plugin.MYI
-rwxrwxrwx 1 mysql mysql   3418 May  2 00:40 proc.frm
-rwxrwxrwx 1 mysql mysql   1144 May  2 00:40 proc.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 proc.MYI
-rwxrwxrwx 1 mysql mysql   2874 May  2 00:40 procs_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 procs_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 procs_priv.MYI
-rwxrwxrwx 1 mysql mysql   2839 May  2 00:40 proxies_priv.frm
-rwxrwxrwx 1 mysql mysql   1269 May  2 00:40 proxies_priv.MYD
-rwxrwxrwx 1 mysql mysql  10240 May  2 00:40 proxies_priv.MYI
-rwxrwxrwx 1 mysql mysql   1661 May  2 00:40 roles_mapping.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 roles_mapping.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 roles_mapping.MYI
-rwxrwxrwx 1 mysql mysql   2703 May  2 00:40 servers.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 servers.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 servers.MYI
-rwxrwxrwx 1 mysql mysql     35 May  2 00:40 slow_log.CSM
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 slow_log.CSV
-rwxrwxrwx 1 mysql mysql   2374 May  2 00:40 slow_log.frm
-rwxrwxrwx 1 mysql mysql   2957 May  2 00:40 tables_priv.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 tables_priv.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 tables_priv.MYI
-rwxrwxrwx 1 mysql mysql   1374 May  2 00:40 table_stats.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 table_stats.MYD
-rwxrwxrwx 1 mysql mysql   2048 May  2 00:40 table_stats.MYI
-rwxrwxrwx 1 mysql mysql    973 May  2 00:40 time_zone.frm
-rwxrwxrwx 1 mysql mysql    971 May  2 00:40 time_zone_leap_second.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_leap_second.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_leap_second.MYI
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone.MYI
-rwxrwxrwx 1 mysql mysql   1146 May  2 00:40 time_zone_name.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_name.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_name.MYI
-rwxrwxrwx 1 mysql mysql   1013 May  2 00:40 time_zone_transition.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_transition.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_transition.MYI
-rwxrwxrwx 1 mysql mysql   1079 May  2 00:40 time_zone_transition_type.frm
-rwxrwxrwx 1 mysql mysql      0 May  2 00:40 time_zone_transition_type.MYD
-rwxrwxrwx 1 mysql mysql   1024 May  2 00:40 time_zone_transition_type.MYI
-rwxrwxrwx 1 mysql mysql   3191 May  2 00:40 user.frm
-rwxrwxrwx 1 mysql mysql    176 May  2 00:40 user.MYD
-rwxrwxrwx 1 mysql mysql   4096 May  2 00:40 user.MYI

mysql/performance_schema:
total 12
drwsrwsrwx 2 mysql mysql 4096 May  2 00:40 .
drwsrwsrwx 4 mysql mysql 4096 May  2 20:51 ..
-rwxrwxrwx 1 mysql mysql   61 May  2 00:40 db.opt

這是 MariaDB 配置文件:

# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

[mysqld]
datadir=/media/user/extdrive1/mysql
socket=/media/user/extdrive1/mysql.sock

[client]
port=3306
socket=/media/user/extdrive1/mysql.sock

ps輔助| grep mysql 返回:

user 21359 0.0 0.0 4772 568 pts/2 S+ 02:27 0:00 grep --color=auto mysql

正如評論中提到的@danblack、@Philᵀᴹ 和 @rick-james 一樣,這是一個權限層次結構問題。雖然/media/user/extdrive1和都具有正確的權限,但由於 和 的權限限制,media/user/extdrive1/mysqlmysql 無法訪問它有權訪問的文件夾。/media``/media/user

謝謝大家的幫助!

引用自:https://dba.stackexchange.com/questions/237370