检查目录权限、apparmor都没问题,处理方法:
vi /usr/lib/systemd/system/mariadb.service
ProtectHome=false
再 systemctl daemon-reload ,最后正常启动数据库服务。
检查日志根源在于Ubuntu系统自动更新导致服务重启,可能数据库的服务配置文件也被更新。
Dec 08 06:58:18 ebs-104035 systemd[1]: Starting Daily apt upgrade and clean activities... Dec 08 06:58:35 ebs-104035 dbus-daemon[627]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.4290' (uid=0 pid=612606 comm="/usr/bin/gdbus call --system --dest org.freedeskto" label="unconfined") Dec 08 06:58:35 ebs-104035 systemd[1]: Starting PackageKit Daemon... Dec 08 06:58:35 ebs-104035 PackageKit[612609]: daemon start Dec 08 06:58:36 ebs-104035 dbus-daemon[627]: [system] Successfully activated service 'org.freedesktop.PackageKit' Dec 08 06:58:36 ebs-104035 systemd[1]: Started PackageKit Daemon. Dec 08 06:58:51 ebs-104035 systemd[1]: Stopping MariaDB 10.3.31 database server... Dec 08 06:58:54 ebs-104035 systemd[1]: mariadb.service: Succeeded. Dec 08 06:58:54 ebs-104035 systemd[1]: Stopped MariaDB 10.3.31 database server.