InnoDB: Operating system error number 13 in a file

安装mysql5.6.28时,修改完datadir= ,使用service mysqld start启动时错误提示

2016-01-06 16:51:56 7f19da6b2720  InnoDB: Operating system error number 13 in a file operation
2016-01-06 16:51:56 8857 [ERROR] InnoDB: Creating or opening ./ibdata1 failed!
2016-01-06 16:51:56 8857 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, 
you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those 
files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2016-01-06 16:51:56 8857 [ERROR] Plugin 'InnoDB' init function returned error.
2016-01-06 16:51:56 8857 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-01-06 16:51:56 8857 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-01-06 16:51:56 8857 [ERROR] Aborting

但是 使用 sh /etc/init.d/mysqld start可以启动,实在是坑

解决方法,关闭selinux  

实时关闭

setenforce 0  或  echo 0 > /selinux/enforce

永久关闭,重启生效

setenforce 0

sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

grep SELINUX= /etc/selinux/config


你可能感兴趣的:(InnoDB: Operating system error number 13 in a file)