Upgrade to Ubuntu 19.10 fail to install mysql-server-8.0

8,845

MySQL Server cannot be started to finish its installation:

Error while setting value 'IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'

One or multiple of these sql modes are no longer available in the new MySQL version. In your case it is NO_AUTO_CREATE_USER.

See a list of valid modes here: https://dev.mysql.com/doc/refman/8.0/en/server-options.html#option_mysqld_sql-mode

Edit your /etc/mysql/my.cnf and remove the non-valid modes from the list at option sql-mode=...

Share:
8,845

Related videos on Youtube

machadoug
Author by

machadoug

Joomla/PHP Developer Working at IdealExtensions.com

Updated on September 18, 2022

Comments

  • machadoug
    machadoug almost 2 years

    Upgrade from 19.04 finished with errors, then when I run sudo apt-get upgrade or sudo apt-get install mysql-server I get:

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    2 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Setting up mysql-server-8.0 (8.0.17-0ubuntu2) ...
    Renaming removed key_buffer and myisam-recover options (if present)
    ERROR: Unable to start MySQL server:
    2019-10-23T04:23:50.510438Z 0 [ERROR] [MY-000077] [Server] /usr/sbin/mysqld: Error while setting value 'IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'.
    2019-10-23T04:23:50.512017Z 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
    dpkg: dependency problems prevent configuration of mysql-server:
     mysql-server depends on mysql-server-8.0; however:
      Package mysql-server-8.0 is not configured yet.
    
    dpkg: error processing package mysql-server (--configure):
     dependency problems - leaving unconfigured
    No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                              Errors were encountered while processing:
     mysql-server-8.0
     mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    I've temporarily enabled "Pre-released updates (eoan-proposed)" and ran sudo apt-get update and sudo apt-get upgrade again with the same results.

    I've been searching but I could not find a suitable solution.

    Any ideas on how to solve this? I don't mind rolling back to the previous mysql-server version as long as the current database is intact.

    TIA

  • Dominic108
    Dominic108 over 4 years
    I could not install mysql-server - something was broken. I tried something similar to this. It was on a computer that I use to test installation from scratch, so I did not care. I renamed /var/lib/mysql to something else, as a backup. I removed mysql-common: sudo apt remove mysql-common. This is a dependency for basic stuff. I kept track of every package that was removed together with mysql-common: colord gnome-control-center hplip libhpmud0 libmysqlclient21 ... a lot more.
  • Dominic108
    Dominic108 over 4 years
    continuing.... I reinstalled all of them immediately after. I checked the size of the new /var/lib/mysql it was larger, which is a good sign. I checked many of the packages that were removed and reinstalled and they seemed fine. I installed mysql-server successfully after that.
  • Dominic108
    Dominic108 over 4 years
    Of course, I would not recommand that with a server in production with active databases. In my case, I had no active databases, except perhaps some databases that come with a fresh installation.