找回密码
 register

QQ登录

只需一步,快速开始

查看: 1753|回复: 0

[*网络运维*] centos 8 启动mysql失败 之 File operation call: 'open'.

[复制链接]

[*网络运维*] centos 8 启动mysql失败 之 File operation call: 'open'.

[复制链接]
  • 打卡等级:热心大叔
  • 打卡总天数:122
  • 打卡月天数:18
  • 打卡总奖励:121
  • 最近打卡:2025-02-22 14:24:44
Waylee

主题

0

回帖

1万

积分

仙帝

积分
14008
Waylee 2021-4-18 19:33 | 显示全部楼层 |阅读模式

马上注册,查看网站隐藏内容!!

您需要 登录 才可以下载或查看,没有账号?register

×
[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)



至此启动成功


您需要登录后才可以回帖 登录 | register

本版积分规则

雪舞知识库 | 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 |天天打卡

GMT+8, 2025-2-22 16:42 , Processed in 0.099835 second(s), 8 queries , Redis On.

Powered by XueWu Licensed

Copyright © Tencent Cloud.

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