rpm安装的mysql如何启动_linux(centos6.9)下rpm方式安装mysql后mysql服务无法启动

以下两种方式启动都报错:启动失败:

[root@node03 ~]# service mysqld start

MySQL Daemon failed to start.

Starting mysqld: [FAILED]

[root@node03 ~]# /etc/init.d/mysqld start

MySQL Daemon failed to start.

Starting mysqld: [FAILED]

原因:旧版本的MySQL软件移除时没有删除原来的数据文件,即 /var/lib/mysql/路径下的内容。

解决方法:删除该路径下的所有内容,包括文件和文件夹。

再次启动,报错另一个错误:

[root@node03 ~]# service mysqld start

Initializing MySQL database: 2019-06-26T16:37:53.977336Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2019-06-26T16:37:54.359914Z 0 [Warning] InnoDB: New log files created, LSN=45790

2019-06-26T16:37:54.431696Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2019-06-26T16:37:54.502670Z 0 [ERROR] unknown variable 'default-character-set=utf8'

2019-06-26T16:37:54.502687Z 0 [ERROR] Aborting

[FAILED]

原因:/etc/my.cnf的配置文件中,我配置了default-character-set,但MySQL5.7貌似不认该参数。

解决方法:把所有的default-character-set配置项注释掉,或删除掉。

再次启动,报第三个错误:

[root@node03 ~]# service mysqld start

Initializing MySQL database: 2019-06-26T16:46:34.713514Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2019-06-26T16:46:34.715422Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.

2019-06-26T16:46:34.715447Z 0 [ERROR] Aborting

[FAILED]

原因:由于第二次的启动失败,在/var/lib/mysql/路径下残留了一些文件,由于MySQL初始化时需要该路径下没有任何内容,所以启动失败。

解决方法:清空该路径下的所有内容。

再次启动,成功!

[root@node03 ~]# service mysqld start

Initializing MySQL database: 2019-06-26T16:47:53.295945Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp se er option (see documentation for more details).

2019-06-26T16:47:53.633116Z 0 [Warning] InnoDB: New log files created, LSN=45790

2019-06-26T16:47:53.699952Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2019-06-26T16:47:53.817335Z 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: 246937da-9832-11e9-9e76-00505632a066.

2019-06-26T16:47:53.826311Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2019-06-26T16:47:53.832203Z 1 [Note] A temporary password is generated for root@localhost: nlaJ#thW=9zQ

[ OK ]

Starting mysqld: [ OK ]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值