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
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 ...;)
source share