设为首页收藏本站 今天是: 2022-08-18    美好的一天,从现在开始
     
切换到窄版

雪舞的天龙知识库

 找回密码
 注册会员
搜索
热搜: 天龙 运维 kali
查看: 487|回复: 0
收起左侧

centos 8 启动mysql失败 之 File operation call: 'open'.

[复制链接]

523

主题

631

帖子

3297

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3297
发表于 2021-4-18 19:33:59 | 显示全部楼层 |阅读模式
[root@localhost ~]# mysqld --defaults-file=/etc/my.cnf --user=mysql &
[1] 2127
[root@localhost ~]# 210418 19:26:30 [Note] Plugin 'FEDERATED' is disabled.
210418 19:26:30  InnoDB: Initializing buffer pool, size = 8.0M
210418 19:26:30  InnoDB: Completed initialization of buffer pool
210418 19:26:30  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.


考虑到mysql服务使用mysql用户启动的,首先增加mysql用户,

useradd -r mysql

修改目录权限:

cd /var/lib/mysql

chown -R mysql.mysql *


再次启动即可:

[root@localhost mysql]# mysqld --defaults-file=/etc/my.cnf --user=mysql &

[1] 2286

[root@localhost mysql]# 210418 19:31:06 [Note] Plugin 'FEDERATED' is disabled.

210418 19:31:06  InnoDB: Initializing buffer pool, size = 8.0M

210418 19:31:06  InnoDB: Completed initialization of buffer pool

210418 19:31:06  InnoDB: Started; log sequence number 0 341206

210418 19:31:06 [Note] Event Scheduler: Loaded 0 events

210418 19:31:06 [Note] mysqld: ready for connections.

Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)



至此启动成功


高级模式
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Loading...
为兴趣而生,注册一起交流。 立即登录云玩 立即注册

QQ|手机版|小黑屋|雪舞的天龙知识库 ( 浙ICP备15015590号-1 )

|浙公网安备33048102000118号

GMT+8, 2022-8-18 22:55 , Processed in 0.082228 second(s), 26 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表