安装snap软件后,mysql无法自定义目录
Tofloor
poster avatar
coldlook
deepin
2019-05-23 02:07
Author
本帖最后由 a375474942 于 2019-5-22 18:11 编辑

想用个最新版Redis Desktop Manager,  所以就安装了个snapd, 默认安装依赖apparmor, 重启后发现mysql 无法启动 ,
  1. ji@deepin:~$ sudo apt depends snapd
  2. snapd
  3.   依赖: adduser
  4.   依赖: apparmor (>= 2.10.95-0ubuntu2.2)
  5.   依赖: ca-certificates
  6. |依赖: gnupg1
  7.     gnupg1:i386
  8.   依赖: gnupg
  9.     gnupg:i386
  10.   依赖: openssh-client
  11.     openssh-client:i386
  12.   依赖: squashfs-tools
  13.   依赖: systemd
  14.     systemd:i386
  15.   依赖: libapparmor1 (>= 2.7.0~beta1+bzr1772)
  16.   依赖: libc6 (>= 2.17)
  17.   依赖: libcap2 (>= 1:2.10)
  18.   依赖: libseccomp2 (>= 2.1.0)
  19.   依赖: libudev1 (>= 183)
  20.   破坏: snap (<< 2013-11-29-5~)
  21.   破坏: snap-confine (<< 2.23)
  22.   破坏: ubuntu-core-launcher (<< 2.22)
  23.   替换: snap (<< 2013-11-29-5~)
  24.   替换: snap-confine (<< 2.23)
  25.   替换: ubuntu-core-launcher (<< 2.22)
Copy the Code

mysql报错:

  1. 2019-05-22T10:05:03.096665Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-1) starting as process 10333 ...
  2. 2019-05-22T10:05:03.099712Z 0 [Note] InnoDB: PUNCH HOLE support available
  3. 2019-05-22T10:05:03.099733Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  4. 2019-05-22T10:05:03.099737Z 0 [Note] InnoDB: Uses event mutexes
  5. 2019-05-22T10:05:03.099739Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
  6. 2019-05-22T10:05:03.099742Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
  7. 2019-05-22T10:05:03.099745Z 0 [Note] InnoDB: Using Linux native AIO
  8. 2019-05-22T10:05:03.099886Z 0 [Note] InnoDB: Number of pools: 1
  9. 2019-05-22T10:05:03.099948Z 0 [Note] InnoDB: Using CPU crc32 instructions
  10. 2019-05-22T10:05:03.100898Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
  11. 2019-05-22T10:05:03.106674Z 0 [Note] InnoDB: Completed initialization of buffer pool
  12. 2019-05-22T10:05:03.108118Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
  13. 2019-05-22T10:05:03.118129Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
  14. 2019-05-22T10:05:03.118160Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
  15. 2019-05-22T10:05:03.118164Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
  16. 2019-05-22T10:05:03.718491Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
  17. 2019-05-22T10:05:03.718515Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  18. 2019-05-22T10:05:03.718519Z 0 [ERROR] Failed to initialize builtin plugins.
  19. 2019-05-22T10:05:03.718522Z 0 [ERROR] Aborting

  20. 2019-05-22T10:05:03.718534Z 0 [Note] Binlog end
  21. 2019-05-22T10:05:03.718569Z 0 [Note] Shutting down plugin 'CSV'
  22. 2019-05-22T10:05:03.718780Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
Copy the Code



目录权限一直都是mysql, 排查目录权限的问题,后台根据 https://www.jianshu.com/p/bf0355bf844f 修改了 /etc/apparmor.d/usr.sbin.mysqld 添加了自定义mysql的data目录, mysql 自定义目录还是无法启动 ,但是默认的目录就没有问题.

  1. [mysqld]
  2. user                = mysql
  3. socket                =/run/mysqld/mysqld.sock
  4. port                = 3306
  5. datadir                = /home/mysql/data
  6. #datadir        = /var/lib/mysql
  7. tmpdir                = /tmp
  8. lc-messages-dir        = /usr/share/mysql
  9. skip-external-locking
  10. key_buffer_size                = 16M
  11. max_allowed_packet        = 16M
  12. thread_stack                = 192K
  13. thread_cache_size       = 8
  14. myisam-recover-options  = BACKUP
  15. log_error =/home/mysql/data/error.log
  16. server-id                = 1
  17. sql-mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  18. #innodb_force_recovery = 1
Copy the Code


哪位大佬知道这个目录的权限怎么配置




Reply Favorite View the author
All Replies
avatar
coldlook
deepin
2019-05-23 04:58
#1
Reply View the author