gpt4 book ai didi

mysql - Centos7安装mysql 5.7.19,报权限之类的错误

转载 作者:行者123 更新时间:2023-11-29 05:59:01 25 4
gpt4 key购买 nike

我想把 mysql 安装在/usr/local/mysql 之外的其他地方。当运行命令'sudo bin/mysqld --defaults-file=/home/hadoop/app/mysql-5.7.19-linux-glibc2.12-x86_64/my.cnf --initialize --user=mysql'时,得到以下错误:

`2017-10-10T02:21:29.369158Z 0 [ERROR] Aborting
`2017-10-10T02:21:27.717508Z 0 [Warning] TIMESTAMP with implicit DEFAULT
`value is deprecated. Please use --explicit_defaults_for_timestamp server
`option (see documentation for more details).
`2017-10-10T02:21:29.109331Z 0 [Warning] InnoDB: New log files created, LSN=45790
`2017-10-10T02:21:29.272647Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
`2017-10-10T02:21:29.347131Z 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: b97c8f3c-ad61-11e7-a737-000c299b2d06.
`2017-10-10T02:21:29.351277Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
`2017-10-10T02:21:29.357864Z 1 [Note] A temporary password is generated for root@localhost: Pl)v)1&Zhl+D
`2017-10-10T02:21:29.369007Z 1 [ERROR] 1 Can't create/write to file '/home/hadoop/app/mysql-5.7.19-linux-glibc2.12-x86_64/data/mysql/db.MYI' (Errcode: 13 - Permission denied)
`2017-10-10T02:21:29.369158Z 0 [ERROR] Aborting

`2017-10-10T02:21:29.496351Z 0 [ERROR] InnoDB: Cannot open '/home/hadoop/app/mysql-5.7.19-linux-glibc2.12-x86_64/data/ib_buffer_pool.incomplete' for writing: Permission denied`

我的.cnf:

[mysqld]
basedir=/home/hadoop/app/mysql-5.7.19-linux-glibc2.12-x86_64
datadir=/home/hadoop/app/mysql-5.7.19-linux-glibc2.12-x86_64/data
port=3307
character-set-server=utf8
server_id=1

最佳答案

您正在以 mysql 用户 (--user=mysql) 运行 mysql 守护进程。但是,您为它提供了一个存在于 hadoop 用户主目录中的路径。 mysql 用户无权访问 hadoop 主目录。

关于mysql - Centos7安装mysql 5.7.19,报权限之类的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46657856/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com