MySQL breaks after upgrade from Ubuntu 14.04LTS to Ubuntu 15.04

16,844

Check the logs while starting mysql:

  • In one terminal: tail -f /var/log/mysql/error.log
  • In another one: sudo service mysql start (maybe you first need to stop the service with sudo service mysql stop).
  • If there are errors, you need to fix them.

In my case I had following errors:

[ERROR] mysqld: unknown variable 'table_cache=256'
[ERROR] Aborting

Due to the mysql issue: table_cache renamed table_open_cache the server didn't start.

Renaming this variable in my settings (/etc/mysql/conf.d/my_custom.cnf) fixed my problem and mysql started as used.

Finally I updated mysql by calling sudo mysql_upgrade -u root -p

Share:
16,844

Related videos on Youtube

KipchirchirIan
Author by

KipchirchirIan

Updated on September 18, 2022

Comments

  • KipchirchirIan
    KipchirchirIan over 1 year

    I recently upgraded from Ubuntu 14.04LTS to 15.04 and during this upgrade, MySQL probably broke. After the upgrade, I ran the command(to start mysql):

    sudo service mysql start
    

    The result was command not found and it suggested I install mysql-server and mysql-common packages which means they were purged during the upgrade. I decided to install the packages again with:

    sudo apt-get install mysql-server
    

    Here is where I encountered problems and errors. This is what appears(part of it) on my terminal when I run the above command:

    Setting up mysql-server-5.6 (5.6.24-0ubuntu2) ...
    Job for mysql.service failed. See "systemctl status mysql.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing package mysql-server-5.6 (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of mysql-server:
     mysql-server depends on mysql-server-5.6; however: 
      Package mysql-server-5.6 is not configured yet.
      Package mysql-community-server which provides mysql-server-5.6 is not installed.
    
    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-5.6
     mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    I have checked almost "similar" problems to this here, here and here but none seem to be helping and this are from older upgrades. Also, I decided to try and install the server,client & workbench from Ubuntu Software Center. There was an error during the installation but it appeared to have installed anyway because from the workbench it showed the server was running. I also happen to have the LAMPP stack in the ./opt folder and there might be a conflict here. The other problem is, I do not have control over the server from the terminal or even the workbench. If I try and access MySQL from the terminal with:

    mycomp:~$ mysql -u user -p
    

    I get the result:

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)
    

    Since Ubuntu 15.04 was released almost a few days ago, solution elsewhere is not easily available. If this post was supposed to be in a MySQL forum then I apologize for this mistake but I would appreciate for any answers given.

    • Admin
      Admin about 9 years
      You can find the solution in the below link stackoverflow.com/questions/11657829/…
    • Admin
      Admin about 9 years
      @vembutech Still does not solve my problem. MySQL server is not configured properly during installation.
  • Pilot6
    Pilot6 about 9 years
    There is no aptitude in standard Ubuntu installation.
  • carbocation
    carbocation almost 9 years
    Substitue apt-get in place of aptitude as needed.
  • Pilot6
    Pilot6 almost 9 years
    You can do it yourself by edit.
  • carbocation
    carbocation almost 9 years
    I mean that if a user does not have aptitude installed, they can use apt-get as needed. If there is a guideline stating that only standard Ubuntu tools should be referenced on this StackExchange site, I'll edit my answer.
  • KipchirchirIan
    KipchirchirIan almost 9 years
    @carbocation aside from that being one of my problems, my main issue is that MySQL is not configuring properly/fully. It breaks halfway. You can see the result I get when I try to install MySQL server above in my question. If that is solved then probably, running the command sudo service mysql start won't be much of a problem.
  • Mike
    Mike almost 9 years
    After fixing the MySQL issues themselves, Ubuntu still wouldn't shutdown MySQL correctly. I had to follow instructions at askubuntu.com/questions/615129/systemd-mysql-wont-stop to resolve this issue.