ubuntu下mysql8安装及启动错误问题解决

小卒子 1年前 ⋅ 3604 阅读
4月 07 12:52:05 smartzeng audit[4143863]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/usr/sbin/mysqld" pid=4143863 comm="apparmor_parser"
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.194:147): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/usr/sbin/mysqld" pid=4143863 comm="apparmor_parser"
4月 07 12:52:05 smartzeng audit[4143864]: AVC apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/data/mysqld_tmp_file_case_insensitive_test.lower-test" pid=4143864 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.458:148): apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/data/mysqld_tmp_file_case_insensitive_test.lower-test" pid=4143864 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.458:149): apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/data/mysqld_tmp_file_case_insensitive_test.lower-test" pid=4143864 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.458:150): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.462:151): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.462:152): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.462:153): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.462:154): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng kernel: audit: type=1400 audit(1680843125.462:155): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng audit[4143864]: AVC apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/data/mysqld_tmp_file_case_insensitive_test.lower-test" pid=4143864 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng audit[4143864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng audit[4143864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng audit[4143864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng audit[4143864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng audit[4143864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng audit[4143864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/media/smartzeng/data/mysql/logs/error.log" pid=4143864 comm="mysqld" requested_mask="ac" denied_mask="ac" fsuid=126 ouid=126
4月 07 12:52:05 smartzeng systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit mysql.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
4月 07 12:52:05 smartzeng systemd[1]: mysql.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit mysql.service has entered the 'failed' state with result 'exit-code'.
4月 07 12:52:05 smartzeng systemd[1]: Failed to start MySQL Community Server.
-- Subject: mysql.service 单元已失败
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- mysql.service 单元已失败。
-- 
-- 结果为“failed”。
 ESCOC

修改usr.sbin.mysqld文件

sudo vim /etc/apparmor.d/usr.sbin.mysqld
# Allow data dir access
  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
  /media/smartzeng/data/mysql** rwk
  • 默认只有var目录下的权限,需要自己添加mysql使用到的其他目录

全部评论: 0

    我有话说: