gpt4 book ai didi

mysql - Ubuntu 无法启动 MySQL 服务

转载 作者:行者123 更新时间:2023-11-29 18:11:57 29 4
gpt4 key购买 nike

编辑/etc/mysql/mysql.conf.d/mysqld.cnf以更改我的绑定(bind)地址以允许外部连接到我的MySQL数据库后,我尝试重新启动MySQL服务以获取以下内容错误:

ubuntu@resonance:/var/www/html$ sudo service mysql start
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

输入这两个命令后,我得到以下信息:

Nov 15 17:45:06 resonance 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.
Nov 15 17:45:06 resonance 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.
Nov 15 17:45:06 resonance audit[24219]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/24219/status" pid=24219 com
Nov 15 17:45:06 resonance audit[24219]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=24
Nov 15 17:45:06 resonance audit[24219]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/24219/status" pid=24219 com
Nov 15 17:45:06 resonance kernel: audit: type=1400 audit(1510767906.536:98): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="
Nov 15 17:45:06 resonance kernel: audit: type=1400 audit(1510767906.536:99): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="
Nov 15 17:45:06 resonance kernel: audit: type=1400 audit(1510767906.536:100): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name=
Nov 15 17:45:08 resonance systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Nov 15 17:45:26 resonance dhclient[1326]: DHCPREQUEST of 10.2.6.251 on ens3 to 10.2.11.18 port 67 (xid=0x7d5eaaff)
Nov 15 17:45:26 resonance dhclient[1326]: DHCPACK of 10.2.6.251 from 10.2.11.18
Nov 15 17:45:26 resonance root[24322]: /etc/dhcp/dhclient-enter-hooks.d/avahi-autoipd returned non-zero exit status 1
Nov 15 17:45:26 resonance dhclient[1326]: bound to 10.2.6.251 -- renewal in 53 seconds.

● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) since Wed 2017-11-15 17:46:38 UTC; 84ms ago
Process: 24586 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 24595 (mysqld); : 24596 (mysql-systemd-s)
Tasks: 3
Memory: 1.4M
CPU: 86ms
CGroup: /system.slice/mysql.service
├─24595 /usr/sbin/mysqld
└─control
├─24596 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─24601 sleep 1

Nov 15 17:46:38 resonance systemd[1]: Starting MySQL Community Server...

知道我做错了什么吗?这是我更改的文件:

https://pastebin.com/pevhYMNK

编辑所以我尝试将绑定(bind)IP更改回127.0.0.1,它再次开始工作。我需要做什么才能允许外部连接?我真的需要它工作。

最佳答案

您应该注释掉配置中的 bind-addressskip-networking 行,然后重新启动。

关于mysql - Ubuntu 无法启动 MySQL 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47314135/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com