Mysql从5.7降级到5.6,现在启动后立即停止

Mysql从5.7降级到5.6,现在启动后立即停止

我在 CentOS 7 上有一个数字海洋水滴。我一开始安装了 5.7,但出于某种原因我想使用 5.6。所以我只是使用 删除了 5.7 yum remove,然后从 yum 禁用 5.7。然后我启用了 5.6 并安装了它。但从那时起它就无法启动。以下是日志文件的转储:

170615 20:39:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-06-15 20:39:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is                       deprecated. Please use --explicit_defaults_for_timestamp server option (see     documentation for more details).
2017-06-15 20:39:49 0 [Note] /usr/sbin/mysqld (mysqld 5.6.36) starting as process 2536 ...
2017-06-15 20:39:49 2536 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2017-06-15 20:39:49 2536 [Warning] Buffered warning: Changed limits: table_open_cache: 431 (requested 2000)

2017-06-15 20:39:49 2536 [Note] Plugin 'FEDERATED' is disabled./usr/sbin/mysqld: Unknown storage engine 'InnoDB
2017-06-15 20:39:49 2536 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2017-06-15 20:39:49 2536 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-06-15 20:39:49 2536 [Note] InnoDB: The InnoDB memory heap is disabled 2017-06-15 20:39:49 2536 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-06-15 20:39:49 2536 [Note] InnoDB: Memory barrier is not used
2017-06-15 20:39:49 2536 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-06-15 20:39:49 2536 [Note] InnoDB: Using Linux native AIO
2017-06-15 20:39:49 2536 [Note] InnoDB: Using CPU crc32 instructions
2017-06-15 20:39:49 2536 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-06-15 20:39:49 2536 [Note] InnoDB: Completed initialization of buffer pool
2017-06-15 20:39:49 2536 [Note] InnoDB: Highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If you are attempting downgrade from MySQL 5.7.9 or later,
InnoDB: please refer to http://dev.mysql.com/doc/refman/5.6/en/upgrading-downgrading.html
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: http://dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html
2017-06-15 20:39:49 2536 [ERROR] Plugin 'InnoDB' init function returned error.
2017-06-15 20:39:49 2536 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-06-15 20:39:49 2536 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-06-15 20:39:49 2536 [ERROR] Aborting

2017-06-15 20:39:49 2536 [Note] Binlog end
2017-06-15 20:39:49 2536 [Note] Shutting down plugin 'partition'
2017-06-15 20:39:49 2536 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-06-15 20:39:49 2536 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-06-15 20:39:49 2536 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'

然后它就关闭了,我不确定还需要做什么才能使用这个版本。

答案1

yum不会删除数据文件。如果您确实想清除旧的 MySQL 安装,您还需要手动删除实际的数据库文件。

yum erase mysql-server    ## or whatever the relevant package name is
rm -rf /var/lib/mysql   

或类似的东西。

小心!这将删除完整的数据库,以便当您安装新版本时,可以从头开始重新创建它(此外,根据您安装的软件包,该目录可能位于其他位置 - 这应该列在/etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
...

如有疑问,请确保已准备好备份!

相关内容