尝试启动MySQL守护程序时发生超时错误.CentOS 5

epe*_*ema 21 mysql timeout centos

我在CentOS上遇到了麻烦.我遇到了一些问题并备份了我的数据库并删除了所有依赖项的mysql.之后我跑了重新安装:

 yum groupinstall "MySQL Database"
Run Code Online (Sandbox Code Playgroud)

安装没有错误.

运行mysql守护进程:

service mysqld start

Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]
Run Code Online (Sandbox Code Playgroud)

我也跑了

# /usr/bin/mysql_install_db --user=mysql
Installing MySQL system tables...
120112  1:49:44 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys'  had only 480 error messages,
but it should contain at least 481 error messages.
Check that the above file is the right version for this program!
120112  1:49:44 [ERROR] Aborting

Installation of system tables failed!

Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
/usr/libexec/mysqld --skip-grant &
and use the command line tool
/usr/bin/mysql to connect to the mysql
database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!
Run Code Online (Sandbox Code Playgroud)

检查日志:

less /var/log/mysqld.log
Run Code Online (Sandbox Code Playgroud)

日志文件为空.我甚至不知道如何调试它,也不知道该怎么做.

有什么建议?

谢谢

Nor*_*ert 38

我知道你很久以前就问过这个问题,但是因为搜索"Timeout错误的人试图启动MySQL守护进程".可能会在这里结束,这个错误有几种可能的解决方案.这里是其中的一些:

首先,而不是运行service mysqld startservice mysqld restart尝试运行:

$ service mysqld stop; mysqld_safe &

脚本中的mysqladmin行存在已知问题/etc/init.d/mysqld.

如果这不起作用,请尝试以下事项:检查是否有足够的可用磁盘空间(尤其是/var):

$ df -h

检查这些文件中是否存在可能的错误消息(并非所有文件都存在):

# tail -n 30 /var/log/messages

# tail -n 30 /var/log/mysqld.log

# tail -n 30 /var/lib/mysql/*.err

# tail -n 30 /var/log/mysql/error.log

接下来,确保/etc/my.cnf使用...

socket=/var/lib/mysql/mysql.sock

......并且目录/var/lib/mysql/实际存在.

设置正确的权限和所有权:

# chown -R mysql.mysql /var/lib/mysql/

# chmod g+w /var/run/mysqld/

# chgrp mysql /var/run/mysqld/

还是行不通?尝试将bind-address更改my.cnf为127.0.0.1或0.0.0.0,或注释掉该行.

如果您仍然运气不好,请搜索更多信息mysql_install_db,因为您的InnoDB数据库可能会被破坏set-variable=innodb_force_recovery=6.


h4u*_*t3r 28

嘿,有时它是因为你的磁盘空间不足...所以运行一个粗略的df -h确保!(这只是发生在我身上:P).


小智 7

启动MySQL服务器的重命名文件之前/var/lib/mysql/ib_logfile0/var/lib/mysql/ib_logfile0然后重新启动服务器

在linux/unix中

mv /var/lib/mysql/ib_logfile0  /var/lib/mysql/ib_logfile0_old
mv /var/lib/mysql/ib_logfile1  /var/lib/mysql/ib_logfile1_old
Run Code Online (Sandbox Code Playgroud)

然后

service mysqld restart
Run Code Online (Sandbox Code Playgroud)