您好,欢迎访问一九零五行业门户网

Linux 中文件和文件夹获取 MySQL 权限(SELinux)

linux 中文件和文件夹获取 mysql 权限(selinux)
首页 → 数据库技术
背景:
阅读新闻
linux 中文件和文件夹获取 mysql 权限(selinux)
[日期:2012-11-22]来源:linux社区 作者:chencong112[字体:]
今天在 linux 系统上移动 mysql 的数据库目录
配置如下:
/etc/my.cnf
[mysqld]
datadir=/home/mysql
socket=/var/lib/mysql/mysql.sock
更改完配置文件重启mysql的时候出现的以下问题
110222 11:15:07 mysqld_safe starting mysqld daemon with databases from /home/mysql
110222 11:15:07 [warning] can't create test file /home/mysql/localhost.lower-test
110222 11:15:07 [warning] can't create test file /home/mysql/localhost.lower-test
 /usr/libexec/mysqld: can't find file: './mysql/plugin.frm' (errno: 13)
110222 11:15:07 [error] can't open the mysql.plugin table. please run mysql_upgrade to create it.
110222 11:15:07  innodb: operating system error number 13 in a file operation.
innodb: the error means mysqld does not have the access rights to
innodb: the directory.
innodb: file name ./ibdata1
innodb: file operation call: 'open'.
innodb: cannot continue operation.
110222 11:15:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
当初以为只是文件或文件夹权限问题,把所有对应的目录和文件的权限改成读写状态...还是没用...
在网上找了一会儿,找到解决方法了~
解决方法如下:
#在终端中先输入下面这一行
chown -r mysql:mysql /home/data/mysql
#在输入下面的一行就ok了
chcon -r -t mysqld_db_t /home/mysql
#重启下mysql试试~
/etc/init.d/mysqld restart
0
pl/sql连不上oracle数据库
利用mysql触发器高性能造数据
相关资讯       selinux  linux selinux
图片资讯
本文评论查看全部评论 (0)
评论声明
最新资讯
本周热门
linux公社简介 - 广告服务 - 网站地图 - 帮助信息 - 联系我们
本站(linuxidc)所刊载文章不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。
copyright © 2006-2014 linux公社 all rights reserved 浙icp备06018118号

其它类似信息

推荐信息