O último erro que recebi me levou a isto: link answer ... que resolveu meu problema. mesmo que eu não entenda por que esses 2 parâmetros estavam lá em primeiro lugar, já que isso era uma instalação limpa?
Na nova instalação do Ubuntu 16.04 e na nova instalação do mysql, eu mudei meus dados do mysql de maneira similar a esta postagem no entanto, depois disso, quando tento reiniciar / iniciar o mysql eu recebo:
error: can't connect to local MySQL server throught socket '/var/run/mysqld/mysql.sock' (2)
Check that mysqld is running and that the socket: '/var/run/mysqld/mysql.sock' exists!
A pasta / var / run / mysqld existe, mas não o arquivo.
Quando eu executo: find / -type s
o arquivo mysql.sock não está na lista.
O resultado de journalctl -xe
:
-- Unit mysql.service has finished shutting down.
Jun 12 11:45:16 wkssop-hev7 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.
Jun 12 11:45:16 wkssop-hev7 audit[5882]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/5882/status" pid=5882 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=110
Jun 12 11:45:16 wkssop-hev7 audit[5882]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=5882 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=0
Jun 12 11:45:16 wkssop-hev7 audit[5882]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/5882/status" pid=5882 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=110
Jun 12 11:45:16 wkssop-hev7 kernel: audit: type=1400 audit(1497260716.044:133): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/5882/status" pid=5882 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=110
Jun 12 11:45:16 wkssop-hev7 kernel: audit: type=1400 audit(1497260716.044:134): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=5882 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=0
Jun 12 11:45:16 wkssop-hev7 kernel: audit: type=1400 audit(1497260716.044:135): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/5882/status" pid=5882 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=110
Jun 12 11:45:17 wkssop-hev7 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
E o resultado de systemctl status mysql.service
é:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since Mon 2017-06-12 11:45:46 CEST; 6s ago
Process: 5986 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 5978 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 5986 (code=exited, status=1/FAILURE); : 5987 (mysql-systemd-s)
Tasks: 2
Memory: 1.4M
CPU: 259ms
CGroup: /system.slice/mysql.service
└─control
├─5987 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─6029 sleep 1
Jun 12 11:45:46 wkssop-hev7 systemd[1]: Starting MySQL Community Server...
Jun 12 11:45:48 wkssop-hev7 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Estes são basicamente os passos que estou seguindo:
if ! service mysql stop ; then
echo "ignoring failure to stop mysql"
fi
cp config/my.cnf /etc/mysql/my.cnf
mkdir -p /data/mysqldata
chmod 777 /data/mysqldata
cp -R -p /var/lib/mysql/* /data/mysqldata
sed "s/\/var\/lib\/mysql/\/data\/mysqldata/g" /etc/apparmor.d/usr.sbin.mysqld > tmp
mv tmp /etc/apparmor.d/usr.sbin.mysqld
apparmor_parser -r /etc/apparmor.d/usr.sbin.mysqld
/etc/init.d/apparmor reload
service mysql restart
Eu recebo o erro na última etapa - reiniciar o serviço, o que não é possível fazer isso.
Eu também adicionei ao perfil do mysql apparmor o / sys / devices / system / node / r, e / sys / devices / system / node / ** r, já que parecia que é um bug que eles não são lá: link
Mas agora eu estou querendo saber se eu deveria fazer o mesmo com: / proc / #### / status, bem, na verdade, teria que ser / proc eu acho? então eu pensei que poderia tentar, e ainda falha.
journatlctl -xe | tail -30:
-- 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.
Jun 14 13:28:50 minint-l35opp1 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Jun 14 13:29:18 minint-l35opp1 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.
Jun 14 13:29:18 minint-l35opp1 systemd[1]: mysql.service: Unit entered failed state.
Jun 14 13:29:18 minint-l35opp1 systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 14 13:29:18 minint-l35opp1 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Jun 14 13:29:18 minint-l35opp1 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.
Jun 14 13:29:18 minint-l35opp1 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.
Jun 14 13:29:20 minint-l35opp1 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE