mysqld: Can‘t change dir to ‘/usr/local/mysql/data/‘ (Errcode: 13 - Permission denied) 报错处理

报错提示:

[root@hecs-399223 bin]# ./mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
mysqld: Can't change dir to '/usr/local/mysql/data/' (Errcode: 13 - Permission denied)
2023-10-27T06:21:51.170236Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-10-27T06:21:51.171947Z 0 [ERROR] failed to set datadir to /usr/local/mysql/data/
2023-10-27T06:21:51.171962Z 0 [ERROR] Aborting

解决方案:

[root@hecs-399223 bin]# chmod -R 777 /usr/local/mysql/data/

再次执行mysql数据库初始化(成功执行)

[root@hecs-399223 bin]# ./mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
2023-10-27T06:29:18.581041Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-10-27T06:29:18.826360Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-10-27T06:29:18.868528Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-10-27T06:29:18.928878Z 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: 288aaf07-7492-11ee-8151-fa163e92ea6c.
2023-10-27T06:29:18.931018Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-10-27T06:29:19.409290Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-10-27T06:29:19.409316Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-10-27T06:29:19.409839Z 0 [Warning] CA certificate ca.pem is self signed.
2023-10-27T06:29:19.670575Z 1 [Note] A temporary password is generated for root@localhost: Y2Eu.8du7Fi<
[root@hecs-399223 bin]# 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值