MySQL启动报错

2021年2月3日 718点热度 0人点赞 0条评论

某项目急需一个MySQL库,于是在CentOS 7.5下配置了系统自带的mariadb server,正常启动是没有问题的。
但是我想把相关的数据文件放置到专门的文件系统,这样就修改了配置,也确认目录是可写的,但是一直无法正常启动!
具体的报错如下:

210202 04:25:42 mysqld_safe Starting mysqld daemon with databases from /u01/mysql
210202  4:25:42 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 28897 ...
210202  4:25:42 [Warning] Can't create test file /u01/mysql/localhost.lower-test
210202  4:25:42 InnoDB: The InnoDB memory heap is disabled
210202  4:25:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
210202  4:25:42 InnoDB: Compressed tables use zlib 1.2.7
210202  4:25:42 InnoDB: Using Linux native AIO
210202  4:25:42 InnoDB: Initializing buffer pool, size = 128.0M
210202  4:25:42 InnoDB: Completed initialization of buffer pool
210202  4:25:42  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: 'create'.
InnoDB: Cannot continue operation.
210202 04:25:42 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

意思就是无法在那个目录下写!
查遍了所有的日志文件,再没有有用的信息了。
只好网搜,结果有人提到需要关闭setenforce,汗,那么这个错误提示可实在是太坑人了!明明是安全方面的配置问题,却明确报错目录写权限问题!
解决方案:setenforce 0

liking

我是雪人

文章评论