MySQL 守护进程无法启动 - centos 6

2023-10-11php开发问题
6

本文介绍了MySQL 守护进程无法启动 - centos 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

查看带有复选标记的答案评论以解决您的问题.

Look at the checkmarked answer comments to get your issue solved.

每当我尝试启动 SQLD 服务时,我都会遇到 MySQL Daemon Failed to Start.我实际上尝试通过执行以下操作来启动"服务:

Whenever I try to start the SQLD service I get MySQL Daemon Failed to Start. I infact tried to "start" the service by doing the following:

service mysqld start

还有

当我输入:mysql

我明白了:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

我知道那个目录下应该有一个mysql.sock文件,所以我创建了一个.但是文件只是自动删除了它自己,我继续收到错误 2002.

I know that there should be a mysql.sock file in that directory, so I create one. But the file just auto removes its self and I continue to get the error 2002.

由于错误,我也无法登录 PHPMyAdmin.我可以访问 phpmyadmin 页面,但在登录时出现:#2002 无法登录 MySQL 服务器

I am also unable to log into PHPMyAdmin due to the error. I can access phpmyadmin page but when logging in I get: #2002 Cannot log in to the MySQL server

这是我的 mysql.log 文件:

Here is my mysql.log file:

131201 13:05:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
131201 13:18:18 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
131201 13:18:18 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
131201 13:18:18 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
131201 13:18:18 InnoDB: The InnoDB memory heap is disabled
131201 13:18:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131201 13:18:18 InnoDB: Compressed tables use zlib 1.2.3
131201 13:18:18 InnoDB: Using Linux native AIO
131201 13:18:18 InnoDB: Initializing buffer pool, size = 128.0M
131201 13:18:18 InnoDB: Completed initialization of buffer pool
131201 13:18:18  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
131201 13:18:18 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

我运行了 mysql_upgrade 并得到了

I ran mysql_upgrade and got

Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed

推荐答案

这个错误最可能的原因是你的 mysql 服务器没有运行.当您输入 mysql 时,您正在执行 mysql 客户端.

The most likely cause for this error is that your mysql server is not running. When you type in mysql you are executing mysql client.

试试:

# sudo service mysql start
# mysql

更新(在问题中包含 OP 后的日志;摘自下面的评论):

Update (after OP included log in the question; taken from the comments below):

谢谢,看到你的日志了.日志说 mysql 用户没有适当的访问权限.我假设你的 mysql 用户是 mysql(这可以在/etc/my.cnf中验证,执行

Thanks, saw your log. The log is saying the mysql user doesn't have proper access rights. I'm assuming your mysql user is mysql(this can be verified in /etc/my.cnf, execute

chown -R mysql:mysql/var/lib/mysql

并再次尝试启动 mysqld.

这篇关于MySQL 守护进程无法启动 - centos 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17