MySQL-安装错误:can‘t create/write to file ‘/home/hadoop/.../db.MYI‘ (Errcode: 13 - Permission denied)

MySQL 初始化命令出错

[root@bi mysql]#  bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/home/hadoop/data/mysql
[root@bi mysql]#  bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/home/hadoop/data/mysql
2023-02-23T12:47:49.502378Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-02-23T12:47:49.502420Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-02-23T12:47:49.502423Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2023-02-23T12:47:49.728116Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-02-23T12:47:49.798465Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-02-23T12:47:49.862328Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 47b19cfe-b378-11ed-9c75-5254004fe427.
2023-02-23T12:47:49.866225Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-02-23T12:47:49.866530Z 1 [Note] A temporary password is generated for root@localhost: o24MtLg,
2023-02-23T12:47:49.875064Z 1 [ERROR] 1  Can't create/write to file '/home/hadoop/data/mysql/mysql/db.MYI' (Errcode: 13 - Permission denied)
2023-02-23T12:47:49.875114Z 0 [ERROR] Aborting

2023-02-23T12:47:49.975434Z 0 [ERROR] InnoDB: Cannot open '/home/hadoop/data/mysql/ib_buffer_pool.incomplete' for writing: Permission denied

解决:
更改 hadoop 目录权限
在这里插入图片描述

# 更改权限
chmod -R 775 /home/hadoop/
# 删除目录下内容
rm -rf /home/hadoop/data/mysql/*
# 重新初始化
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/home/hadoop/data/mysql

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值