Error installing MySQl 5.7 on Kubuntu 16.04

Configuring mysql-server-5.7 (5.7.11-0ubuntu6) ... insserv: warning: current start start (empty) from mysql' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script script mysql' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script mysql' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script mysql 'overrides the default values ​​for LSB (0 1 6). mysql_upgrade: received error: 2002: it was not possible to connect to the local MySQL server through the socket '/var/run/mysqld/mysqld.sock' (2) an error occurred while connecting to the MySQL server updating process and will not continue. Mysql_upgrade error with exit status 11 dpkg: error with mysql-server-5.7 (--configure):

apt-get remove returns the same result.

This error occurs when upgrading from 15.10 to 16.04

+5
source share
7 answers

This was exactly the same for me: runlevel warnings and mysql_upgrade error.

I assume this was due to the fact that I turned off the mysql service, resolving the problem:

sudo systemctl enable mysql

+11
source

I just ran into this problem, there is an error report here: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1584287

In my case, the mysql.service parameter was disabled for mysql.service , and the mysql_upgrade script seemed unable to start the server in this case. I turned on the service (no need to start it) and restarted the update. After that, I stopped the service and turned it off again.

I'm not sure what else might cause this, but if someone encounters this with a disabled service, just enable it to update.

+2
source

Manually delete the entire MySQL server file

0
source

It looks like the mysql server is now replaced with mariadb

Installing the maridb server fixes the problem.

sudo apt-get install mariadb-server

Note. - You will not receive your databases. Reset mysql password with mysql_secure_installation command

0
source

In my case, I could solve the problem by changing apparmor (on kubuntu 16.04 using plasma). I took a look at journalctl -xe as suggested in the installation error message:

 [....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. 

There I found the apparmor DENIED posts:

 AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/home/system/var/log/mysql/error.log" pid=32610 comm="mysqld" request 

In the document, the base directory /home/system/... exists, but access is not allowed to /etc/apparmor.d/usr.sbin.mysqld .

So, adding the following lines to /etc/apparmor.d/local/usr.sbin.mysqld , I solved my problem:

 # For more details, please see /etc/apparmor.d/local/README. # Allow log file access /home/system/var/log/mysql.err rw, /home/system/var/log/mysql.log rw, /home/system/var/log/mysql/ r, /home/system/var/log/mysql/** rw, 

Remember to restart apparmor and restart the mysql installation (e.g. apt-get install --reinstall mysql-common mysql-server or whatever you can install.)

I don’t know at all why (and since then) the /home/system directory exists and why mysql indicates there. But one day I hope I find out ...;)

0
source

Below it worked for me, found a solution - here

  • sudo update-alternatives --remove my.cnf / etc / mysql / my.cnf.migrated
  • sudo service mysql start
0
source

I found a solution here

  • Delete all mysql files: rm -r /var/lib/mysql*
  • Installing the mysql database: mysql_install_db -u mysql (may not work for newer systems, but don't worry)
  • Enable service for systemd: systemctl unmask mysql.service
  • Then run mysql service service mysql start
-1
source

Source: https://habr.com/ru/post/1247758/


All Articles