【发布时间】:2020-03-27 00:18:48
【问题描述】:
我使用带有 OSMC 作为操作系统的树莓派 3 以及 Debian Stretch 和 nginx,并按照我不久前在某处找到的一些说明手动安装了 mariaDB 10.2。
我已将 mariadb 的 datadir 更改为 /media/USBHDD2/shared/mysql
当我启动或重新启动 pi 时,mariaDB 无法启动。之前,当我有默认的 datadir = /var/lib/mysql 时,一切都很好。换回来就好了。
但是,如果我登录到控制台,我可以使用
成功启动它service mysql start
请注意,我使用的是 'service' 而不是 'systemctl' - 后者不起作用。 mariadb.service 和 mysql.service 文件在任何地方都不存在。
在 /etc/init.d 中,我找到了两个文件:mysql 和 myswql,它们似乎是相同的。如果我从目录中删除 myswql,mariadb 将根本无法启动。例如,我尝试通过在开头添加 sleep 15 来编辑这些内容,但无济于事。我已经阅读了有关尝试测试 USBHDD2 是否已安装的各种解决方案,例如使用
while ! test -f /media/USBHDD2/shared/test.txt
do
sleep 1
done
我在 /etc/init.d/mysql 和 myswql 文件中尝试过,在调用 mysql 启动之前也在 rc.local 中尝试过。 但这也不起作用。
我还将 rc?.d 中的链接重命名为 S99mysql,所以在其他所有内容之后开始,仍然没有乐趣。
我花了整整两天的时间来解决这个问题。我需要做些什么才能让它工作,以便 mysql 在启动时启动?
文件系统是 ntfs
ls -la //media/USBHDD2/shared/mysql 的输出如下:
total 176481
drwxrwxrwx 1 root root 4096 Mar 27 11:41 .
drwxrwxrwx 1 root root 4096 Mar 27 13:06 ..
-rwxrwxrwx 1 root root 16384 Mar 27 11:41 aria_log.00000001
-rwxrwxrwx 1 root root 52 Mar 27 11:41 aria_log_control
-rwxrwxrwx 1 root root 0 Nov 3 2016 debian-10.1.flag
-rwxrwxrwx 1 root root 12697 Mar 27 11:41 ib_buffer_pool
-rwxrwxrwx 1 root root 50331648 Mar 27 11:41 ib_logfile0
-rwxrwxrwx 1 root root 50331648 Mar 26 22:02 ib_logfile1
-rwxrwxrwx 1 root root 79691776 Mar 27 11:41 ibdata1
drwxrwxrwx 1 root root 32768 Mar 25 18:37 montegov_admin
-rwxrwxrwx 1 root root 0 Nov 3 2016 multi-master.info
drwxrwxrwx 1 root root 20480 Sep 3 2019 mysql
drwxrwxrwx 1 root root 0 Sep 3 2019 performance_schema
drwxrwxrwx 1 root root 86016 Mar 25 20:06 rentmaxpro_wp187
drwxrwxrwx 1 root root 0 Sep 3 2019 test
drwxrwxrwx 1 root root 32768 Nov 3 2016 trustedhomerenta_admin
drwxrwxrwx 1 root root 32768 Nov 3 2016 trustedhomerenta_demo
drwxrwxrwx 1 root root 40960 Mar 25 21:05 trustedhomerenta_meta
drwxrwxrwx 1 root root 36864 Mar 25 21:25 trustedhomerenta_montego
drwxrwxrwx 1 root root 36864 Mar 26 20:37 trustedhomerenta_testmontego
【问题讨论】:
-
假设 OSMC 有 udev 规则,在那里创建一个特定于 USB 的规则,上面有数据(按文件系统名称?)以启动服务。
-
媒体是什么文件系统?
ls -la //media/USBHDD2/shared/mysql显示什么?