请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

初始化失败

[root@tc data]# mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
2021-08-20T03:02:02.237316Z 0 [Warning] [MY-011070] [Server] ‘Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it’ is deprecated and will be removed in a future release.
2021-08-20T03:02:02.237374Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.15) initializing of server in progress as process 2960
2021-08-20T03:02:02.238115Z 0 [Warning] [MY-013242] [Server] --character-set-server: ‘utf8’ is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2021-08-20T03:02:02.239168Z 0 [ERROR] [MY-010124] [Server] Fatal error: Can’t change to run as user ‘mysql’ ; Please check that the user exists!
2021-08-20T03:02:02.239171Z 0 [ERROR] [MY-013236] [Server] Newly created data directory /usr/local/mysql/data/ is unusable. You can safely remove it.
2021-08-20T03:02:02.239212Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-08-20T03:02:02.239312Z 0 [System] [MY-010910] [Server] /usr/local/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.15) MySQL Community Server - GPL.

[root@tc data]# vim etc/my.cnf
[root@tc data]# vim /etc/my.cnf

[mysqld]
datadir=/usr/local/mysql/data
basedir=/usr/local/mysql
socket=/tmp/mysql.sock
character-set-server=utf8
skip-grant-tables
socket=/var/lib/mysql/mysql.sock

Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

Settings user and group are ignored when systemd is used.

If you need to run mysqld under a different user or group,

customize your systemd unit file for mariadb according to the

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

include all files from the config directory

!includedir /etc/my.cnf.d

老师,这是什么原因了

正在回答

1回答

你的系统中存在mysql这个账号吗?要初始化前要先使用user add mysql 增加mysql 系统账号。
0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信