在Ubuntu 安装mariadb 再restart 后出现错误
journalctl -xe
发现
apparmor权限问题
AppArmor 是一款与SeLinux类似的安全框架/工具,其主要作用是控制应用程序的各种权限,例如对某个目录/文件的读/写,对网络端口的打开/读/写等等。
在Ubuntu下通过命令sudo apparmor_status可以查看当前AppArmor的状态。
重启apparmor,Apparmor的启动、停止等操作的相关命令如下:
Start : sudo /etc/init.d/apparmor start
Stop : sudo /etc/init.d/apparmor stop
reload: sudo /etc/init.d/apparmor reload
Show status: sudo /etc/init.d/apparmor status
解决mysql aparmor权限问题:
1. sudo aa-status
shows you what apparmor is doing; what actually has an enforced policy, versus what's just set to complain.
2. sudo apt-get install apparmor-utils
adds a few commands that make the apparmor profiles easier to deal with, such as...
3. sudo aa-complain /usr/sbin/mysqld
turns the profile from "enforce" to complain. (aa-enforce turns it back.)
但是出现问题
解决方法:disabled the profile (with aa-disable which seems to be equivalent to plutocrat's solution)
执行
sudo aa-disable /usr/sbin/mysqld
4. sudo service apparmor reload 如果reload无效,则reboot,之后mariadb start well、