Welcome 微信登录

首页 / 数据库 / MySQL / Ubuntu 9.10 修改 MySQL 的 datadir

新安装完Ubuntu 9.10, 想把MySQL的datadir设为/home/mysql. 修改my.cnf后, 重启失败. 查系统日志, 有如下记录:Nov  7 10:41:25 agroom mysqld: 091107 10:41:25 [Warning] Can"t create test file /home/mysql/agroom.lower-testNov  7 10:41:25 agroom kernel: [ 2806.844060] type=1503 audit(1257561685.971:187): operation="mknod" pid=5620 parent=5506 profile="/usr/sbin/mysqld" requested_mask="w::" denied_mask="w::" fsuid=0 ouid=0 name="/home/mysql/agroom.lower-test"...Nov  7 10:41:26 agroom mysqld: InnoDB: The error means mysqld does not have the access rights toNov  7 10:41:26 agroom mysqld: InnoDB: the directory.Nov  7 10:41:26 agroom mysqld: InnoDB: File name ./ibdata1Nov  7 10:41:26 agroom mysqld: InnoDB: File operation call: "open".Nov  7 10:41:26 agroom mysqld: InnoDB: Cannot continue operation.Nov  7 10:41:26 agroom kernel: [ 2806.902273] type=1503 audit(1257561686.031:190): operation="open" pid=5620 parent=5506 profile="/usr/sbin/mysqld" requested_mask="rw::" denied_mask="rw::" fsuid=113 ouid=113 name="/home/mysql/ibdata1"应该是与权限有关, 更像是与某种安全机制有关. ubuntu 9.10默认未启用SELinux, 但是好像有个apparmor. 这时想起my.cnf里有段注释:[mysqld]## * Basic Settings### * IMPORTANT#   If you make changes to these settings and your system uses apparmor, you may#   also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.#查看/etc/apparmor.d/usr.sbin.mysqld, 的确是一些目录的权限设置. 照样加入/home/mysql. 重启成功在MySQL中修改表名的SQL语句Oracle并购SUN应放松对MySQL控制相关资讯      mysql  Ubuntu 9.10 
  • 数据库服务器 MySQL  (08/15/2013 06:50:23)
  • MySQL 5.6 GA 及逃亡潮  (02/08/2013 14:36:35)
  • MySQL 5.5.22、5.1.62、5.0.96全线  (03/22/2012 19:03:49)
  • MySQL Administrator连接VMWare下  (05/24/2013 09:20:58)
  • MySQL 5.1.68 发布  (02/05/2013 08:37:47)
  • CentOS 5.2+MySQL+Heartbeat双机互  (01/29/2012 11:16:55)
本文评论 查看全部评论 (0)
表情: 姓名: 字数