gpt4 book ai didi

mysql服务器无法以root身份启动

转载 作者:行者123 更新时间:2023-11-30 22:24:52 25 4
gpt4 key购买 nike

以 root 身份启动 mysql 服务器失败。

1.服务mysqld启动

Starting mysqld:                                           [FAILED]

2.mysqld错误日志:

2016-02-23T01:19:16.961857Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2016-02-23T01:19:16.963350Z 0 [Note] mysqld (mysqld 5.7.10) starting as process 20924 ...

2016-02-23T01:19:16.965669Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

2016-02-23T01:19:16.965715Z 0 [ERROR] Aborting

2016-02-23T01:19:16.965737Z 0 [Note] Binlog end

2016-02-23T01:19:16.965818Z 0 [Note] mysqld: Shutdown complete

但可以以 mysql 用户身份启动 mysql 服务,或者使用 mysqld_safe 作为 root 也可以启动。怎么了?

/etc/init.d/msyqld start

MySQL Daemon failed to start.

Starting mysqld: [FAILED]

if ! /bin/kill -0 $safe_pid 2>/dev/null; then
echo "MySQL Daemon failed to start."
ret=1
break
fi
... ...
if [ $ret -eq 0 ]; then
action $"Starting $prog: " /bin/true
touch $lockfile
else
action $"Starting $prog: " /bin/false
fi

我在脚本/etc/init.d/mysqld 中找到了这个代码片段。但不知道为什么?

最佳答案

将此行添加到 /etc/my.cnf 的 [mysqld] 部分

explicit_defaults_for_timestamp = 1

检查这个link

关于mysql服务器无法以root身份启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35567182/

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