免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 49420 | 回复: 7
打印 上一主题 下一主题

MySQL/MariaDB无法启动 [复制链接]

论坛徽章:
18
2015年迎新春徽章
日期:2015-03-04 10:16:53操作系统版块每日发帖之星
日期:2016-05-11 06:20:0015-16赛季CBA联赛之佛山
日期:2016-05-06 22:28:4415-16赛季CBA联赛之广夏
日期:2016-04-22 23:24:00操作系统版块每日发帖之星
日期:2016-04-21 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44操作系统版块每日发帖之星
日期:2016-02-03 06:20:00IT运维版块每日发帖之星
日期:2016-01-31 06:20:00IT运维版块每日发帖之星
日期:2016-01-30 06:20:00IT运维版块每日发帖之星
日期:2016-01-24 06:20:00IT运维版块每日发帖之星
日期:2016-01-23 06:20:00操作系统版块每日发帖之星
日期:2015-11-26 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-12-07 10:57 |只看该作者 |倒序浏览
本帖最后由 SeAL80s 于 2015-12-07 12:37 编辑

      系统Fedora 23 x86_64 XFCE4.12

      MySQL是用的Oracle官方源(官方现在是MySQL 5.7 ),MariaDB是用的Fedora的源(10.0.21)

      MySQL在执行mysql_secure_installation的时候

      Securing the MySQL server deployment.
      Enter password for user root:

      这个时候还没有MySQL密码的,输入root密码或者直接回车确认,都会报:
     Error: Access denied for user 'root'@'localhost' (using password: YES)
     Error: Access denied for user 'root'@'localhost' (using password: NO)


     #systemctl status mysqld

● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since 一 2015-12-07 08:57:44 CST; 1h 33min ago
  Process: 10569 ExecStart=/usr/sbin/mysqld --daemonize $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 10554 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 10575 (mysqld)
   CGroup: /system.slice/mysqld.service
           └─10575 /usr/sbin/mysqld --daemonize

12月 07 08:57:43 MyHost.MyDomain systemd[1]: Starting MySQL Server...
12月 07 08:57:44 MyHost.MyDomain systemd[1]: Started MySQL Server.
12月 07 10:24:19 MyHost.MyDomain systemd[1]: Started MySQL Server.

        #systemctl start mysqld 后没有任何反应

      另外,my.cnf也很可疑:跟以前手工编译安装的时候不太一样啊,是不是MySQL本身的错误啊?!

# For advice on how to change settings please see
# dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

卸载MySQL我都是dnf remove mysql-community-server,还有其他的文件需要手动删除吗?/etc/my.cnf在remove mysql-community-server后变成了/etc/my.cnf.rpmsave

     MariaDB安装的情况类似,不过信息稍微多一些

# systemctl status mariadb
● mariadb.service - MariaDB 10.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 一 2015-12-07 08:39:12 CST; 2h 2min ago
Main PID: 7881 (code=exited, status=0/SUCCESS)

12月 07 08:39:11 MyHost.MyDomain systemd[1]: Starting MariaDB 10.0 database server...
12月 07 08:39:11 MyHost.MyDomain mysqld_safe[7881]: 151207 08:39:11 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
12月 07 08:39:11 MyHost.MyDomain mysqld_safe[7881]: 151207 08:39:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
12月 07 08:39:11 MyHost.MyDomain mysqld_safe[7881]: 151207 08:39:11 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
12月 07 08:39:12 MyHost.MyDomain systemd[1]: mariadb.service: Control process exited, code=exited status=1
12月 07 08:39:12 MyHost.MyDomain systemd[1]: Failed to start MariaDB 10.0 database server.
12月 07 08:39:12 MyHost.MyDomain systemd[1]: mariadb.service: Unit entered failed state.
12月 07 08:39:12 MyHost.MyDomain systemd[1]: mariadb.service: Failed with result 'exit-code'.
12月 07 08:50:48 MyHost.MyDomain systemd[1]: Stopped MariaDB 10.0 database server.

# systemctl start mariadb

Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

var/log/mariadb/mariadb.log

151207 08:39:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151207  8:39:11 [Note] /usr/libexec/mysqld (mysqld 10.0.21-MariaDB) starting as process 8005 ...
151207  8:39:11 [Note] InnoDB: Using mutexes to ref count buffer pool pages
151207  8:39:11 [Note] InnoDB: The InnoDB memory heap is disabled
151207  8:39:11 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
151207  8:39:11 [Note] InnoDB: Memory barrier is not used
151207  8:39:11 [Note] InnoDB: Compressed tables use zlib 1.2.8
151207  8:39:11 [Note] InnoDB: Using Linux native AIO
151207  8:39:11 [Note] InnoDB: Not using CPU crc32 instructions
151207  8:39:11 [Note] InnoDB: Initializing buffer pool, size = 128.0M
151207  8:39:11 [Note] InnoDB: Completed initialization of buffer pool
151207  8:39:11 [Note] InnoDB: Highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html //论坛不让发链接。现在是MariaDB,怎么还是h t t p://dev.mysql.com,难道是MySQL与MariaDB有混淆?为了装个MysQL/MariaDB,我可是重装了Fedora的!
151207  8:39:11 [ERROR] Plugin 'InnoDB' init function returned error.
151207  8:39:11 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151207  8:39:11 [Note] Plugin 'FEEDBACK' is disabled.
151207  8:39:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
151207  8:39:11 [ERROR] Unknown/unsupported storage engine: InnoDB //MariaDB好像是不用InnoDB引擎了吧?难道真的是与MySQL有混?我是格式化/,/boot,SWAP的,只是挂载/home,以前也是直接挂载/home,也没出现这个问题啊?在/home/username下会有MySQL/MariaDB遗留东西?我在重装前,都执行一遍$rm -rf .*的啊...
151207  8:39:11 [ERROR] Aborting

151207  8:39:11 [Note] /usr/libexec/mysqld: Shutdown complete

151207 08:39:11 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
151207 10:42:18 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151207 10:42:18 [Note] /usr/libexec/mysqld (mysqld 10.0.21-MariaDB) starting as process 9350 ...
151207 10:42:18 [Note] InnoDB: Using mutexes to ref count buffer pool pages
151207 10:42:18 [Note] InnoDB: The InnoDB memory heap is disabled
151207 10:42:18 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
151207 10:42:18 [Note] InnoDB: Memory barrier is not used
151207 10:42:18 [Note] InnoDB: Compressed tables use zlib 1.2.8
151207 10:42:18 [Note] InnoDB: Using Linux native AIO
151207 10:42:18 [Note] InnoDB: Not using CPU crc32 instructions
151207 10:42:18 [Note] InnoDB: Initializing buffer pool, size = 128.0M
151207 10:42:18 [Note] InnoDB: Completed initialization of buffer pool
151207 10:42:18 [Note] InnoDB: Highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html //论坛不能发链接去掉了http
151207 10:42:18 [ERROR] Plugin 'InnoDB' init function returned error.
151207 10:42:18 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151207 10:42:18 [Note] Plugin 'FEEDBACK' is disabled.
151207 10:42:18 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
151207 10:42:18 [ERROR] Unknown/unsupported storage engine: InnoDB
151207 10:42:18 [ERROR] Aborting

151207 10:42:18 [Note] /usr/libexec/mysqld: Shutdown complete

151207 10:42:18 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

求解!!!多谢!

论坛徽章:
18
2015年迎新春徽章
日期:2015-03-04 10:16:53操作系统版块每日发帖之星
日期:2016-05-11 06:20:0015-16赛季CBA联赛之佛山
日期:2016-05-06 22:28:4415-16赛季CBA联赛之广夏
日期:2016-04-22 23:24:00操作系统版块每日发帖之星
日期:2016-04-21 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44操作系统版块每日发帖之星
日期:2016-02-03 06:20:00IT运维版块每日发帖之星
日期:2016-01-31 06:20:00IT运维版块每日发帖之星
日期:2016-01-30 06:20:00IT运维版块每日发帖之星
日期:2016-01-24 06:20:00IT运维版块每日发帖之星
日期:2016-01-23 06:20:00操作系统版块每日发帖之星
日期:2015-11-26 06:20:00
2 [报告]
发表于 2015-12-07 12:11 |只看该作者
本帖最后由 SeAL80s 于 2015-12-07 13:41 编辑

用了MariaDB的源,安装了10.1.9稳定版
结果
#systemctl status mariadb
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since 一 2015-12-07 10:42:19 CST; 1h 27min ago
Main PID: 9225 (code=exited, status=0/SUCCESS)

12月 07 10:42:17 MyHost.MyDomain systemd[1]: Starting MariaDB 10.0 database server...
12月 07 10:42:18 MyHost.MyDomain mysqld_safe[9225]: 151207 10:42:18 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
12月 07 10:42:18 MyHost.MyDomain mysqld_safe[9225]: 151207 10:42:18 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
12月 07 10:42:18 MyHost.MyDomain mysqld_safe[9225]: 151207 10:42:18 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
12月 07 10:42:19 MyHost.MyDomain systemd[1]: mariadb.service: Control process exited, code=exited status=1
12月 07 10:42:19 MyHost.MyDomain systemd[1]: Failed to start MariaDB 10.0 database server.
12月 07 10:42:19 MyHost.MyDomain systemd[1]: mariadb.service: Unit entered failed state.
12月 07 10:42:19 MyHost.MyDomain systemd[1]: mariadb.service: Failed with result 'exit-code'.
12月 07 11:08:17 MyHost.MyDomain systemd[1]: Stopped MariaDB 10.0 database server.

为什么还显示10.0啊?!
而且/etc/my.cnf显示:
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

如何彻底清楚已安装的MySQL啊?还是说systemd还在读取旧的mysql,mysql卸载后没有清除服务吗?这个是谁的责任?dnf 没有卸载?还是mysql没有提供服务清除脚本?还是systemd没有更新状态?
求教!!!!!!!!

论坛徽章:
18
2015年迎新春徽章
日期:2015-03-04 10:16:53操作系统版块每日发帖之星
日期:2016-05-11 06:20:0015-16赛季CBA联赛之佛山
日期:2016-05-06 22:28:4415-16赛季CBA联赛之广夏
日期:2016-04-22 23:24:00操作系统版块每日发帖之星
日期:2016-04-21 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44操作系统版块每日发帖之星
日期:2016-02-03 06:20:00IT运维版块每日发帖之星
日期:2016-01-31 06:20:00IT运维版块每日发帖之星
日期:2016-01-30 06:20:00IT运维版块每日发帖之星
日期:2016-01-24 06:20:00IT运维版块每日发帖之星
日期:2016-01-23 06:20:00操作系统版块每日发帖之星
日期:2015-11-26 06:20:00
3 [报告]
发表于 2015-12-07 12:38 |只看该作者
现在有点感觉,是不是systemd有问题啊

论坛徽章:
18
2015年迎新春徽章
日期:2015-03-04 10:16:53操作系统版块每日发帖之星
日期:2016-05-11 06:20:0015-16赛季CBA联赛之佛山
日期:2016-05-06 22:28:4415-16赛季CBA联赛之广夏
日期:2016-04-22 23:24:00操作系统版块每日发帖之星
日期:2016-04-21 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44操作系统版块每日发帖之星
日期:2016-02-03 06:20:00IT运维版块每日发帖之星
日期:2016-01-31 06:20:00IT运维版块每日发帖之星
日期:2016-01-30 06:20:00IT运维版块每日发帖之星
日期:2016-01-24 06:20:00IT运维版块每日发帖之星
日期:2016-01-23 06:20:00操作系统版块每日发帖之星
日期:2015-11-26 06:20:00
4 [报告]
发表于 2015-12-07 18:30 |只看该作者
是我的问题太初级了,还是我的问题太高级了,明白的朋友吱一声哦。。。

论坛徽章:
223
2022北京冬奥会纪念版徽章
日期:2015-08-10 16:30:32操作系统版块每日发帖之星
日期:2016-05-10 19:22:58操作系统版块每日发帖之星
日期:2016-02-18 06:20:00操作系统版块每日发帖之星
日期:2016-03-01 06:20:00操作系统版块每日发帖之星
日期:2016-03-02 06:20:0015-16赛季CBA联赛之上海
日期:2019-09-20 12:29:3219周年集字徽章-周
日期:2019-10-01 20:47:4815-16赛季CBA联赛之八一
日期:2020-10-23 18:30:5320周年集字徽章-20	
日期:2020-10-28 14:14:2615-16赛季CBA联赛之广夏
日期:2023-02-25 16:26:26CU十四周年纪念徽章
日期:2023-04-13 12:23:10操作系统版块每日发帖之星
日期:2016-05-10 19:22:58
5 [报告]
发表于 2015-12-07 23:03 |只看该作者
参考官方升级办法,这个真没有经验

论坛徽章:
18
2015年迎新春徽章
日期:2015-03-04 10:16:53操作系统版块每日发帖之星
日期:2016-05-11 06:20:0015-16赛季CBA联赛之佛山
日期:2016-05-06 22:28:4415-16赛季CBA联赛之广夏
日期:2016-04-22 23:24:00操作系统版块每日发帖之星
日期:2016-04-21 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44操作系统版块每日发帖之星
日期:2016-02-03 06:20:00IT运维版块每日发帖之星
日期:2016-01-31 06:20:00IT运维版块每日发帖之星
日期:2016-01-30 06:20:00IT运维版块每日发帖之星
日期:2016-01-24 06:20:00IT运维版块每日发帖之星
日期:2016-01-23 06:20:00操作系统版块每日发帖之星
日期:2015-11-26 06:20:00
6 [报告]
发表于 2015-12-08 08:17 |只看该作者
本帖最后由 SeAL80s 于 2015-12-21 11:16 编辑

解决了!留给解决办法,给有相同问题的朋友!
在systemd系统里移除service
#dnf remove mysql-community-server
#rm /etc/my.cnf
#rm -rf /var/lib/mysql
#rm -rf /usr/share/mysql
#rm -rf /usr/lib/mysql
查询mysql服务
#systemctl list-unit-files | grep mysql
#systemctl disable mysqld.service
#systemctl disable mysql.service
#rm -rf /var/run/mysql/
#rm /etc/mecabrc
#rm /usr/lib/systemd/system/mysqld.service
#rm /etc/systemd/system/mysqld.service
#rm /etc/systemd/system/mysql.service
这样就完全干掉MySQL了,然后重新安装基本就没问题了。之前的问题,就是系统里MySQL/MariaDB混了
清除掉MySQL,之后无论是安装MySQL还是MariaDB应该都没问题了(我只装了MariaDB,没问题。MySQL没测试,应该也是可以的。另外,Fedora 23里的MariaDB还是10.0系列,要安装最新的10.1,要换MariaDB官方的repo
官方的repo只写了F20/F21,自己替换一下版本号就可以了)

评分

参与人数 1可用积分 +12 收起 理由
send_linux + 12 感谢分享!

查看全部评分

论坛徽章:
223
2022北京冬奥会纪念版徽章
日期:2015-08-10 16:30:32操作系统版块每日发帖之星
日期:2016-05-10 19:22:58操作系统版块每日发帖之星
日期:2016-02-18 06:20:00操作系统版块每日发帖之星
日期:2016-03-01 06:20:00操作系统版块每日发帖之星
日期:2016-03-02 06:20:0015-16赛季CBA联赛之上海
日期:2019-09-20 12:29:3219周年集字徽章-周
日期:2019-10-01 20:47:4815-16赛季CBA联赛之八一
日期:2020-10-23 18:30:5320周年集字徽章-20	
日期:2020-10-28 14:14:2615-16赛季CBA联赛之广夏
日期:2023-02-25 16:26:26CU十四周年纪念徽章
日期:2023-04-13 12:23:10操作系统版块每日发帖之星
日期:2016-05-10 19:22:58
7 [报告]
发表于 2015-12-14 17:06 来自手机 |只看该作者
社区也在搞分裂了,大家都是怎么站队的呢

论坛徽章:
18
2015年迎新春徽章
日期:2015-03-04 10:16:53操作系统版块每日发帖之星
日期:2016-05-11 06:20:0015-16赛季CBA联赛之佛山
日期:2016-05-06 22:28:4415-16赛季CBA联赛之广夏
日期:2016-04-22 23:24:00操作系统版块每日发帖之星
日期:2016-04-21 06:20:00IT运维版块每周发帖之星
日期:2016-03-07 16:27:44操作系统版块每日发帖之星
日期:2016-02-03 06:20:00IT运维版块每日发帖之星
日期:2016-01-31 06:20:00IT运维版块每日发帖之星
日期:2016-01-30 06:20:00IT运维版块每日发帖之星
日期:2016-01-24 06:20:00IT运维版块每日发帖之星
日期:2016-01-23 06:20:00操作系统版块每日发帖之星
日期:2015-11-26 06:20:00
8 [报告]
发表于 2015-12-21 17:00 |只看该作者
MySQL 5.7 安装后无法执行mysql_secure_installation
执行就提示要输入root密码,在5.6,第一次执行,会提示,密码为空,直接回车,然后设置密码。在5.7,要去mysql.log里找临时密码,但是马上会提示临时密码已经过期,要求改密码,新改密码不管怎么输入,都会提示:密码不符合要求,因为字母大小写混合+数字+加减号混合都不可以。用临时密码可以执行
mysql -uroot -p登陆

我想问一下,mysql_secure_installation不能用,是5.7的bug,还是说5.7有了重大变化,属于正常?如果是正常,那么在安装阶段给人找这么多麻烦,mysql的开发者是不是抽风了?果断换MariaDB
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP