Loading [MathJax]/jax/output/CommonHTML/config.js
社区首页 >问答首页 >MySQL服务器无法启动: mysql.service失败,因为控制进程退出并带有错误代码。

MySQL服务器无法启动: mysql.service失败,因为控制进程退出并带有错误代码。
EN

Ask Ubuntu用户
提问于 2017-05-13 16:15:42
回答 1查看 37.4K关注 0票数 3

MySQL服务器在我安装Drupal (上一个版本)时停止工作。然后我重新安装了MySQL服务器,但没有成功。它没能启动。

sudo service mysql start输出

代码语言:javascript
代码运行次数:0
复制
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输出

代码语言:javascript
代码运行次数:0
复制
? mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Sat 2017-05-13 23:40:38 UTC; 5s ago
  Process: 32760 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 32744 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 32760 (code=exited, status=1/FAILURE); Control PID: 32763 (mysql-systemd-s)
Tasks: 2 (limit: 4915)
   Memory: 736.0K
   CPU: 58ms
   CGroup: /system.slice/mysql.service
       +-control
         +-  308 sleep 1
         +-32763 /bin/bash /usr/share/mysql/mysql-systemd-start post
May 13 23:40:38 ubuntu-512mb-tor1-01 systemd[1]: Starting MySQL Community Server...
May 13 23:40:38 ubuntu-512mb-tor1-01 mysql-systemd-start[32744]: my_print_defaults: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysql-systemd-start[32744]: my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:40:38 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

journalctl -xe输出

代码语言:javascript
代码运行次数:0
复制
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=32760 comm="mysqld" requested_mask="
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.737:7854): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=3
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=32760 comm="mysqld" requested
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=32760 comm="mysqld" requested_mask="
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.741:7855): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.741:7856): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=3
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:40:38 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
--
-- The result is failed.
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Unit entered failed state.
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Failed with result 'exit-code'.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has finished shutting down.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has begun starting up.
May 13 23:41:09 ubuntu-512mb-tor1-01 mysql-systemd-start[362]: my_print_defaults: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:41:09 ubuntu-512mb-tor1-01 mysql-systemd-start[362]: my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.245:7857): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378 comm="mysqld" requested_mask="r" den
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=378 comm="mysqld" requested_mas
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378 comm="mysqld" requested_mask="r" den
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.249:7858): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.249:7859): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378
May 13 23:41:09 ubuntu-512mb-tor1-01 mysqld[378]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:41:09 ubuntu-512mb-tor1-01 mysqld[378]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
lines 2142-2184/2184 (END)
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=32760 comm="mysqld" requested_mask="
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.737:7854): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=3
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=32760 comm="mysqld" requested
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=32760 comm="mysqld" requested_mask="
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.741:7855): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.741:7856): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=3
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:40:38 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
--
-- The result is failed.
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Unit entered failed state.
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Failed with result 'exit-code'.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has finished shutting down.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has begun starting up.
May 13 23:41:09 ubuntu-512mb-tor1-01 mysql-systemd-start[362]: my_print_defaults: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:41:09 ubuntu-512mb-tor1-01 mysql-systemd-start[362]: my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.245:7857): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378 comm="mysqld" requested_mask="r" den
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=378 comm="mysqld" requested_mas
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378 comm="mysqld" requested_mask="r" den
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.249:7858): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.249:7859): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378
May 13 23:41:09 ubuntu-512mb-tor1-01 mysqld[378]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:41:09 ubuntu-512mb-tor1-01 mysqld[378]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
EN

回答 1

Ask Ubuntu用户

发布于 2019-07-11 04:54:37

我只是通过删除mysql-server包解决了这个问题。

代码语言:javascript
代码运行次数:0
复制
sudo apt remove mysql-server

我有Ubuntu和LAMP,当我启动LAMP时,mysqld (mysql-server)无法运行。它提出的错误完全是你的错。我希望这个卸载mysql-server包的解决方案对您有用。

票数 -1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/914946

复制
相关文章
使用Kubernetes身份在微服务之间进行身份验证
如果您的基础架构由相互交互的多个应用程序组成,则您可能会遇到保护服务之间的通信安全以防止未经身份验证的请求的问题。
有点技术
2020/12/22
7.9K0
windows以管理员身份运行服务bat
此处是关闭再运行打印机相关服务 %1 start "" mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c ""%~s0"" ::","","runas",1)(window.close)&&exit net stop Spooler net start Spooler net stop PrintNotify net start PrintNotify 保存为bat即可执行 我们还可以将bat放入 C:\
阿超
2022/08/21
2.2K0
WPF开发之以管理员身份运行
管理员运行 1.打开项目的属性 2.选择“安全性”,勾选启用ClickOnce安全设置 3.然后会在Properties里自动生成 app.manifest 打开app.manifest中修改为如下配
码客说
2020/08/02
2.3K0
Win10 开启以管理员身份运行
ctrl + shift + esc 快捷键开启任务管理器选择 文件 点击 运行新任务
忆想不到的晖
2020/11/06
3.5K0
Win10 开启以管理员身份运行
Win10 开启以管理员身份运行
ctrl + shift + esc 快捷键开启任务管理器选择 文件 点击 运行新任务
ZackSock
2020/06/29
3.7K0
设置始终以管理员身份运行cmd窗口
在桌面上找到cmd快捷方式图标,右键"属性" 4.选择"快捷方式",点击“高级” 5.勾选用管理员身份运行,点击"确定" 6.点击"应用",点击"确定" 7.双击桌面cmd快捷方式,此时cmd窗口已经
跟着阿笨一起玩NET
2019/06/20
5.3K0
Windows 10 设置始终以管理员身份运行
有些程序需要以管理员身份运行,正常操作可以右键选择管理员身份运行: image.png 但每次都这样操作太麻烦了。来一个一劳永逸的方法: 1. 找到程序所在的位置 以Word为例,首先找到Word的进程,然后右键打开文件所在位置: image.png 2. 设置运行权限 右键程序,选择兼容性疑难解答: image.png 点击下一步: image.png 选择疑难解答程序: image.png 勾选”该程序需要附加权限“,再点击下一步: image.png 点击测试程序,然后再点击下一步: image.pn
Mr. Wei
2018/06/20
1.6K0
Windows 10 设置始终以管理员身份运行
如何使用GPG密钥进行SSH身份验证
GPGTools为OS X提供了最简单的GPG实现。否则,js brew install gnupg2如果你有Homebrew,你可以运行。
evildickman
2018/09/04
8.7K1
mongoDB身份验证
为了更安全的访问mongodb,需要访问者提供用户名和密码,于是需要在mongodb中创建用户
周小董
2019/03/25
1.7K0
mongoDB身份验证
如何让Delphi程序启动自动“以管理员身份运行"
由于Vista以后win中加入的UAC安全机制,采用Delphi开发的程序如果不右键点击“以管理员身份运行”,则会报错。 在XE2以上的Delphi版本处理这个问题已经非常简单了。 右建点击工程,选择“Options”->“Applicaion”下,将Runtime themes项设置为“Use Custom manifest”,点击下方按钮,选择相应的Manifest文件即可。 需要注意的是:Debug和Release模式不同,要进行同样设置 至于Manifest文件,也就
战神伽罗
2019/07/24
2.5K0
WordPress 插件 MasterStudy LMS 2.7.5 - 未经身份验证的管理员帐户创建
# 软件链接:https://wordpress.org/plugins/masterstudy-lms-learning-management-system/
Khan安全团队
2022/03/09
8180
WordPress 插件 MasterStudy LMS 2.7.5 - 未经身份验证的管理员帐户创建
# 版本:<2.7.6 # https://www.youtube.com/watch?v=SI_O6CHXMZk # https://gist.github.com/numanturle/4762b
Khan安全团队
2022/03/03
5100
如何让程序启动时以管理员身份运行
1. 添加应用程序清单文件(Application Manifest File)
宿春磊Charles
2021/11/05
2.1K0
结合VBS,实现批处理自动以管理员身份执行
这是我在百度回答知友时写的,用于自动以管理员身份执行命令或程序→百度原址 批处理代码,功能:自动以管理员身份执行 test.exe: start admin.vbs   runas /user:administrator test.exe admin.vbs 代码(延时是为了成功传值给 bat 命令,确保成功) dim wsh   set wsh=WScript.CreateObject("WScript.Shell")   WScript.Sleep 3000   wsh.SendKeys "你的
张戈
2018/03/26
2.3K0
shiro——Shiro身份验证
   Subject:主体,代表了当前“用户”,这个用户不一定是一个具体的人,与当前应用交互的任何东西都是Subject,如网络爬虫,机器人等;即一个抽象概念;所有Subject 都绑定到SecurityManager,与Subject的所有交互都会委托给SecurityManager;可以把Subject认为是一个门面;SecurityManager才是实际的执行者;    SecurityManager:安全管理器;即所有与安全有关的操作都会与SecurityManager 交互;且它管理着所有Subject;可以看出它是Shiro 的核心,它负责与后边介绍的其他组件进行交互,如果学习过SpringMVC,你可以把它看成DispatcherServlet前端控制器;    Realm:域,Shiro从从Realm获取安全数据(如用户、角色、权限),就是说SecurityManager要验证用户身份,那么它需要从Realm获取相应的用户进行比较以确定用户身份是否合法;也需要从Realm得到用户相应的角色/权限进行验证用户是否能进行操作;可以把Realm看成DataSource,即安全数据源。
用户10196776
2022/11/22
1.9K0
shiro——Shiro身份验证
WebService 之 身份验证
  在项目开发,我们经常会使用WebService,但在使用WebService时我们经常会考虑到了WebService是安全问题,很容易想到通过一组用户名与密码来防止非法用户的调用 。 一、NetworkCredential方式   在 System.Net 命名空间中提供了一个NetworkCredential,通过它我们可以在网络中提供一个凭证,只有获得该凭证的用户才能访问相应的服务的权限。在NetworkCredential 中,我们通过提供WebService发布所在的服务器名称,以及登录服务器并
郑小超.
2018/01/26
2.7K0
使用JAVA进行ad域身份验证常用属性详解
一些变态的公司经常对开发者提出一些变态的问题。比如在oa系统中,要求登录验证必须使用ad域进行登录。还有的如登录crm系统必须使用公司的邮箱账号进行身份验证等等。 作为程序员我们只能按照客户的需求进行完善系统。毕竟客户才是我们的衣食父母,没办法拒绝。我这里就列举一些,在系统中集成ad域身份验证的一些配置信息,并一一解释他们的作用。 直接看代码:
业余草
2019/01/21
2.7K0
以管理员身份修改hosts文件_如何修改hosts文件权限
修改host文件的时候若不是以管理员的身份,无权限修改host中的内容。简单说明如何使用powershell的方法修改host文件。
全栈程序员站长
2022/11/08
7.2K1
以管理员身份修改hosts文件_如何修改hosts文件权限
OAuth 2.0身份验证
浏览网络时,几乎可以肯定您会遇到一些使您可以使用社交媒体帐户登录的网站,该功能很可能是使用流行的OAuth 2.0框架构建的,OAuth 2.0对于攻击者来说非常有趣,因为它非常常见,而且天生就容易出现实现错误,这可能导致许多漏洞,从而使攻击者可以获得敏感用户数据,并有可能绕过身份验证。
Al1ex
2021/04/22
3.5K0
OAuth 2.0身份验证
Win10怎么设置以管理员身份运行cmd命令
我们先找到cmd.exe命令所在的位置,然后右键发送到桌面快捷方式: 然后选中该快捷方式右键,选择属性 然后按照如下截图步骤操作: 设置好后,双击打开快捷方式,就是以管理员身份运行cmd.exe了!
黑泽君
2019/02/26
2.3K0

相似问题

Windows内核内存保护

22

Windows、Emacs、Git Bash和shell命令

34

Windows 7上的Emacs构建过程

10

OSX/Bash -检测构建失败

30

如何在Windows 10 Bash上使用X Windows和Emacs?

32
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文