我把一个mysql服务器从5.7.14降级到5.6.32。
在这样做之后,我假设我应该运行mysql_upgrade,根据我遇到的说明。
但是,要这样做,我需要提供root用户/p,我已经有了。但是,当我尝试这样做时,它似乎不接受这些用户:
mysql_upgrade -u root -p
请输入密码:
Looking for 'blog' as:blog
Looking for 'blog' as:blog
错误:获取服务器版本时失败!可能是由于未经授权的访问。
致命错误:升级失败
因此,我尝试重置密码,方法是创建一个init文件,内容如下:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('abcd 1234');然后使用mysqld_safe --init-file=/home/root/mysql-init &
但这似乎不起作用,大概是因为mysql无法正确启动并抛出错误。
0802 12:50:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2016-08-02 12:50:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is
2016-08-02 12:50:46 0 [Note] /usr/sbin/mysqld (mysqld 5.6.32) starting as process 2635 ...
2016-08-02 12:50:46 2635 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Unknown storage engine 'InnoDB'
2016-08-02 12:50:46 2635 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2016-08-02 12:50:46 2635 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-08-02 12:50:46 2635 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-02 12:50:46 2635 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-02 12:50:46 2635 [Note] InnoDB: Memory barrier is not used
2016-08-02 12:50:46 2635 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-02 12:50:46 2635 [Note] InnoDB: Using Linux native AIO
2016-08-02 12:50:46 2635 [Note] InnoDB: Using CPU crc32 instructions
2016-08-02 12:50:46 2635 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-02 12:50:46 2635 [Note] InnoDB: Completed initialization of buffer pool
2016-08-02 12:50:46 2635 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-02 12:50:46 2635 [Note] InnoDB: The log sequence numbers 2512357 and
2512357 in ibdata files do not match the log sequence number 2512396 in $
2016-08-02 12:50:46 2635 [Note] InnoDB: Database was not shutdown normally!
2016-08-02 12:50:46 2635 [Note] InnoDB: Starting crash recovery.
2016-08-02 12:50:46 2635 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-08-02 12:50:46 2635 [Note] InnoDB: Restoring possible half-written data pages
2016-08-02 12:50:46 2635 [Note] InnoDB: from the doublewrite buffer...
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
17:50:46 UTC - mysqld got signal 11 ;
字符串
这似乎让我陷入了一个循环,我不能运行mysql_upgrade来升级数据库,但我不能成功地重置root密码(尽管我99.9%确定我得到了正确的root密码,但它似乎不接受它。
堆栈跟踪
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x8e2375]
/usr/sbin/mysqld(handle_fatal_signal+0x494)[0x666da4]
/lib64/libpthread.so.0[0x398620f790]
/usr/sbin/mysqld[0xac1017]
/usr/sbin/mysqld[0xac25fd]
/usr/sbin/mysqld[0xa3de77]
/usr/sbin/mysqld[0x9822dd]
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x48)[0x5aa958]
/usr/sbin/mysqld[0x6f01e1]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0xbb6)[0x6f4046]
/usr/sbin/mysqld[0x59ce38]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x425)[0x5a2055]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3985e1ed5d]
/usr/sbin/mysqld[0x593ba5]
型
有什么建议吗?谢谢
2条答案
按热度按时间ou6hu8tu1#
你遇到的指令是完全错误的。唯一重要的指令是那些from MySQL:
支持的降级方法包括:
mysqldump
转储新MySQL版本中的所有表,然后将转储文件加载到旧MySQL版本中。**对于同一发布系列内GA版本之间的降级以及发布级别之间的降级,支持逻辑降级。**例如,从5.7.10到5.7.9的降级和从5.7到5.6的降级支持逻辑降级。有关过程,请参见执行就地降级和执行逻辑降级。
请注意我的粗体。您唯一支持的选项是使用
mysqldump
提取数据库的副本,然后将其导入到旧版本。希望您有一些备份!wvyml7n52#
我试图做一个就地降级,而不是逻辑降级。
我能够恢复5.7.14组件,并尝试逻辑降级的操作。
然而,这也不起作用,因为this改变了用户表结构。最终,我不得不在降级,恢复,使用skip-grant-tables选项启动服务后对mysql.user表进行核处理,然后重新创建表,重新添加我的用户,并重新授予权限。这是有趣的一天。