I just had a bear of a time running apt-get update to upgrade mysql to version 5.7.13-0ubuntu0.16.04.2 (from what version, I do not know... any idea how to find out?).

I had to create a new /var/lib/mysql directory and run "mysqld --initialize" to initialize a new installation there, then change the root password so I could get in (through several steps), then create the debian stsyem user in the database with the expected password and permissions, THEN run the upgrade.

However, it is still running on that "fresh" database now, rather than my database specefied in my own "datadir" statement in my "local.cnf" file, which is in the "/etc/mysql/mysql.conf.d/" folder (and, yes, i've done "cat * | grep datadir" in both linked directories and this is the only uncommented datadir line).

When i ran mysqld with the strace command, i saw that is ended up also loading an "auto.cnf" "file" at the end. I wonder if this is what is overriding my datadir?

Also, I tried removing the /var/lib/mysql directory and creating a symlink to my custom path and I get an error that the system database doesn't exist and to initialize the database...

Also, i would like to point out that I checked my apparmour rules and they look correct (and have always worked before today and haven't changed) to allow access to those directories.

I'm exhausted from hours of this and hopefully someone can point out what easy step I'm missing in getting my database back up.

A million thanks will be sent in your direction if you can help!


  • What version of Ubuntu are you using? – Android Dev Aug 14 '16 at 0:14
  • 16.04 - fully updated. – mobrien118 Aug 22 '16 at 21:18
  • As it turns out, the reason I've been having issues is that somehow the "mysql" database directory disappeared... Obviously, I have bigger issues now that I'm trying to sort out. After creating a "new" one and bringing over all of the other databases, some are working, others are not... Hopefully I can figure this out... – mobrien118 Aug 28 '16 at 4:26

Your Answer

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

Browse other questions tagged or ask your own question.