MySQL fail after Ubuntu 20.04 upgrade

I used Ubuntu 18.04 with LAMP, Python, Dockers, etc. Once, I received a message, that my laptop ready to upgrade, I accepted and the updating process starts. On the 50% of process, I received a message, that something went wrong and Ubuntu stop to upgrade. During rebooting I saw the message:

[FAILED] Failed to start MySQL Community Server.

So I tried to know the status of my MySQL: systemctl status mysql.service and have got result:

     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2020-11-29 10:46:34 EET; 6h ago

лис 29 10:46:34 it-HP-250-G7-Notebook-PC mysql-systemd-start[1635]: Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips o>
лис 29 10:46:34 it-HP-250-G7-Notebook-PC mysql-systemd-start[1635]: Once the problem is resolved, restart the service.
лис 29 10:46:34 it-HP-250-G7-Notebook-PC systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
лис 29 10:46:34 it-HP-250-G7-Notebook-PC systemd[1]: mysql.service: Failed with result 'exit-code'.
лис 29 10:46:34 it-HP-250-G7-Notebook-PC systemd[1]: Failed to start MySQL Community Server.
лис 29 10:46:34 it-HP-250-G7-Notebook-PC systemd[1]: mysql.service: Scheduled restart job, restart counter is at 6.
лис 29 10:46:34 it-HP-250-G7-Notebook-PC systemd[1]: Stopped MySQL Community Server.
лис 29 10:46:34 it-HP-250-G7-Notebook-PC systemd[1]: mysql.service: Start request repeated too quickly.
лис 29 10:46:34 it-HP-250-G7-Notebook-PC systemd[1]: mysql.service: Failed with result 'exit-code'.
лис 29 10:46:34 it-HP-250-G7-Notebook-PC systemd[1]: Failed to start MySQL Community Server.

Next I tried to fix all packages: sudo apt-get update, sudo apt-get upgrade but in the final command line see next warning:

2020-11-29T15:12:34.680279Z 0 [ERROR] [MY-000077] [Server] /usr/sbin/mysqld: Error while setting value 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,N
O_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'.
2020-11-29T15:12:34.696826Z 0 [ERROR] [MY-010119] [Server] Aborting
Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
Once the problem is resolved, run apt-get --fix-broken install to retry.
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1

Next i tried fix all installations: sudo apt-get --fix-broken install, nothing helps me. I do not want to delete MySQL because I have actual DataBaces, it is important for me.

Any suggestions?


Please check the answer here: https://stackoverflow.com/a/67747756/6652972

Thank you @FANO_FN. This was the line in /etc/mysql/mysql.conf.d/mysqld.cnf which needed to be corrected. mysql8 doesn't have the value of NO_AUTO_CREATE_USER sql_mode anymore. So, I removed that from the list of values and it started working.

The final values look like below:

sql_mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

The reason is that NO_AUTO_CREATE_USER is no longer part of mysql8.