16

I’m trying to install MySQL server on Ubuntu 16.04 using:

sudo apt-get install mysql-server

I get asked to set and confirm root password and then the install hangs at:

Renaming removed key_buffer and myisam-recover options (if present)

I’ve exited the install and purged MySQL and tried again, but the issue persists.

TRiG
  • 1,167
  • 2
  • 13
  • 30
panthro
  • 365
  • 1
  • 2
  • 8

5 Answers5

10

Same problem, found fix at https://omgdebugging.com/2016/09/04/fixing-hung-up-mysql-installation-on-ubuntu-16-04-lts/. I ran (as root) (sleep 200; killall mysqld)& then immediately apt-get install -y mysql-server mysql-client in my provisioning script.

Iiridayn
  • 294
  • 2
  • 12
2

After purging, check your /var/lib/mysql directory if it contains any files, and move those to other place or delete before trying to re-install.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • 2
    Thanks, I delete the files under /var/lib/mysql after a purge, still hangs on Renaming removed key_buffer and myisam-recover options (if present) – panthro Oct 11 '16 at 09:49
0

mysql often has problems with upgrades if you have used systemctl to disable it from starting at the same time as the OS.

Run systemctl status mysql.service as root and see if it started, and check if it is enabled or disabled. If it is disabled, run systemctl enable mysql.service, then run systemctl start mysql.service and then try upgrading again.

0

Just incase the blog becomes a dead link in the future. This is the solution.

sudo rm -rf /var/lib/mysql to remove the leftovers.

saviour123
  • 170
  • 5
0

If you don't want to delete all of your databases... in my case this was an apparmor problem. I fixed it by disabling apparmor for mysqld with: apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld