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:
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.

| improve this question | | | | |

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

| improve this answer | | | | |

You may have figured this out already, but hopefully it may help someone else running into the same problem.

My 14.10-15.04 upgrade stuck at where the process tried to start mysqld with some obscure message about root admin password. I proceeded to see what mysqld process is running, and found that its process id is completely different than the one the upgrade process said it was going to start a new mysqld at. so I thought a "sudo /etc/init.d/mysql stop" might help. And lo and behold the upgrade process zoomed all the way to completion.

(Oops. Wrong post. I'll post this in another thread. Sorry about that)

Good luck.

| improve this answer | | | | |

For me, MySQL broke after I upgraded from 14.04 to 15.04 and after I switched from systemd back to Upstart.

Interestingly, I could start mysql manually, but I could not get it to start via /etc/init.d/ (i.e., with sudo service mysql start). After reading over the Ubuntu Upstart script, it became clear that Ubuntu expects apparmor to be present in order to run MySQL from Upstart.

Therefore, the solution that worked for me:

  1. sudo aptitude install apparmor

And that was all that was needed.

| improve this answer | | | | |
  • There is no aptitude in standard Ubuntu installation. – Pilot6 May 20 '15 at 6:21
  • Substitue apt-get in place of aptitude as needed. – carbocation May 20 '15 at 16:56
  • You can do it yourself by edit. – Pilot6 May 20 '15 at 16:57
  • 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. – carbocation May 21 '15 at 11:40
  • @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. – KipchirchirIan Jun 5 '15 at 10:49

I was getting similar error and nothing I saw on internet could help. The problem turned out to be a stupid one. I had previously changed the default data directory of mysql to a secondary hard disk. As this disk was not mounted I was getting the error.

To check if such access problems is causing the error for you, find the current data directory of mysql in the mysql config file.

less /etc/mysql/mysql.conf.d/mysqld.cnf

in some cases the path to the target config file could be slightly different:

less /etc/mysql/my.cnf

Look for the entry for datadir and copy the path. See if that directory is accessible by the cd command.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.