我从Ubuntu18升级到Ubuntu20,mySQL升级失败。升级后,我再次尝试安装mysql-server。我得到了下面的错误。
ERROR: Unable to start MySQL server:
2021-05-29T02:51:22.812281Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2021-05-29T02:51:22.812291Z 0 [ERROR] [MY-000077] [Server] /usr/sbin/mysqld: Error while setting value 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'.
2021-05-29T02:51:22.813552Z 0 [ERROR] [MY-010119] [Server] Aborting使用的命令:sudo apt install mysql-server
我在升级到Ubuntu20之后使用了上面的命令。我甚至试着编辑配置,但没有帮助。以下是/etc/mysql/mysql.cnf的内容:
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"我在这里发现了一个类似的问题:https://askubuntu.com/questions/1296168/mysql-fail-after-ubuntu-20-04-upgrade
发布于 2021-05-29 12:33:55
谢谢你@FANO_FN。这是/etc/mysql/mysql.conf.d/mysqld.cnf中需要更正的那一行。mysql8不再具有NO_AUTO_CREATE_USER sql_mode的价值。所以,我从值列表中删除了它,它开始工作了。
最终的值如下所示:
sql_mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
https://stackoverflow.com/questions/67747357
复制相似问题