【发布时间】:2017-12-07 05:52:09
【问题描述】:
我正在按照本教程在我的 Digital Ocean droplet 上设置 MySQL 服务器,但使用的是 Ubuntu 16.04。
当我将 'bind-address' 设置为 localhost 或公共服务器的 ip 时,我可以重新启动服务器,但是当我尝试使用私有 ip 时,我得到一个错误。
$ sudo service mysql restart
投掷:
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
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-07-03 23:23:36 UTC; 10s ago
Process: 16717 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 16709 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 16717 (code=exited, status=1/FAILURE); : 16718 (mysql-systemd-s)
Tasks: 2
Memory: 332.0K
CPU: 338ms
CGroup: /system.slice/mysql.service
└─control
├─16718 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─16768 sleep 1
Jul 03 23:23:36 inradar-db-production systemd[1]: Starting MySQL Community Server...
Jul 03 23:23:38 inradar-db-production systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
journalctl -xe(最后几行)
Jul 03 23:24:37 inradar-db-production audit[16926]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/16926/status" pid=169
Jul 03 23:24:37 inradar-db-production audit[16926]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/"
Jul 03 23:24:37 inradar-db-production kernel: audit: type=1400 audit(1499124277.901:460): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Jul 03 23:24:37 inradar-db-production kernel: audit: type=1400 audit(1499124277.901:461): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Jul 03 23:24:37 inradar-db-production audit[16926]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/16926/status" pid=169
Jul 03 23:24:37 inradar-db-production kernel: audit: type=1400 audit(1499124277.905:462): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld"
Jul 03 23:24:39 inradar-db-production systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
lines 2193-2214/2214 (END)
有什么问题?
【问题讨论】:
-
您必须首先检查:有关详细信息,请参阅“systemctl status mysql.service”和“journalctl -xe”。有哪些细节?也许一些有用的错误细节
-
我已经更新了描述
-
我在该网址上找不到解决方案。他们看起来和我一样迷茫。您是否注意到任何相关建议?
-
我不确定,但这似乎是解决方案:“GET_AROUND: sudo nano /etc/apparmor.d/usr.sbin.mysqld line 25 after: # Allow config access /etc/mysql/ ** r, -add line: /etc/mysql/* r, systemctl restart apparmor.service service mysql stop service mysql start - 问题消失”
标签: mysql ubuntu-16.04 digital-ocean