While starting the MySql server I am continuously getting this error. The path for the sock file that is mentioned is /var/run/mysqld/mysqld.sock . I tried to find it in other ways to but the file is missing.
after running systemctl status mysql.service the output is given be
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since Thu 2017-08-24 12:58:44 UTC; 26s ago
Process: 19985 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 19976 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 19985 (code=exited, status=1/FAILURE); : 19986 (mysql-systemd-s)
Tasks: 2
Memory: 328.0K
CPU: 262ms
CGroup: /system.slice/mysql.service
└─control
├─19986 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─20068 sleep 1
Aug 24 12:58:44 ip-172-31-25-190 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Aug 24 12:58:44 ip-172-31-25-190 systemd[1]: Stopped MySQL Community Server.
Aug 24 12:58:44 ip-172-31-25-190 systemd[1]: Starting MySQL Community Server...
Aug 24 12:58:46 ip-172-31-25-190 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
After running journalctl -xe following output got generated.
Aug 24 12:58:44 ip-172-31-25-190 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Aug 24 12:58:44 ip-172-31-25-190 kernel: audit: type=1400 audit(1503579524.748:818): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/19985/sta
Aug 24 12:58:44 ip-172-31-25-190 kernel: audit: type=1400 audit(1503579524.748:819): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/sy
Aug 24 12:58:44 ip-172-31-25-190 kernel: audit: type=1400 audit(1503579524.748:820): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/19985/sta
Aug 24 12:58:44 ip-172-31-25-190 audit[19985]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/19985/status" pid=19985 comm="mysqld" reque
Aug 24 12:58:44 ip-172-31-25-190 audit[19985]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=19985 comm="mysqld
Aug 24 12:58:44 ip-172-31-25-190 audit[19985]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/19985/status" pid=19985 comm="mysqld" reque
Aug 24 12:58:46 ip-172-31-25-190 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Aug 24 12:59:14 ip-172-31-25-190 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Aug 24 12:59:14 ip-172-31-25-190 systemd[1]: mysql.service: Unit entered failed state.
Aug 24 12:59:14 ip-172-31-25-190 systemd[1]: mysql.service: Failed with result 'exit-code'.
Aug 24 12:59:14 ip-172-31-25-190 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Aug 24 12:59:14 ip-172-31-25-190 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
Aug 24 12:59:14 ip-172-31-25-190 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Aug 24 12:59:15 ip-172-31-25-190 kernel: audit: type=1400 audit(1503579555.004:821): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20089/sta
Aug 24 12:59:15 ip-172-31-25-190 audit[20089]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20089/status" pid=20089 comm="mysqld" reque
Aug 24 12:59:15 ip-172-31-25-190 audit[20089]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=20089 comm="mysqld
Aug 24 12:59:15 ip-172-31-25-190 audit[20089]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20089/status" pid=20089 comm="mysqld" reque
Aug 24 12:59:15 ip-172-31-25-190 kernel: audit: type=1400 audit(1503579555.012:822): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/sy
Aug 24 12:59:15 ip-172-31-25-190 kernel: audit: type=1400 audit(1503579555.012:823): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/20089/sta
Aug 24 12:59:16 ip-172-31-25-190 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
This error code appearing whenever I am uncommenting the following lines in /etc/mysql/mysql.conf.d/mysqld.cnf
general_log_file = /var/log/mysql/mysql.log
general_log= 1
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 1
log-queries-not-using-indexes = 1
What should be done to resolve the same?