I upgraded from Ubuntu 18 to Ubuntu 20. mySQL upgrade failed during the upgrade. After the upgrade, I again tried to install mysql-server. I’m getting the below error.
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
Command used: sudo apt install mysql-server
I used the above command after upgrade to Ubuntu20. I even tried to edit the configuration, but that didn’t help. Below are the contents of /etc/mysql/mysql.cnf:
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
I found a similar question here: https://askubuntu.com/questions/1296168/mysql-fail-after-ubuntu-20-04-upgrade