今天早些时候经历了宕机,服务器恢复以后,网站就挂了。
访问 tony1ee.com 提示建立数据库连接时出错。
ssh 连接服务器,启动 mysql 遇到了问题
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
登入phpmyadmin也登入不上
应该是Mysql出的问题
当时是一键安装的 lnmp 现在求助大伙这是个什么情况,怎么解决?
1
Livid MOD 看 MySQL 的出错日志,里面会有具体的错误信息。
|
2
McContax 2016-06-20 11:10:13 +08:00 via Android
打个赌,内存被 php-fpm 占满, Mysql 内存不足挂掉
|
4
9hills 2016-06-20 11:14:56 +08:00
打个赌, MySQL 数据文件损坏无法启动
|
5
Tony1ee OP |
6
izoabr 2016-06-20 11:17:52 +08:00
手工启动一下数据库,然后看下日志
|
7
lijinma 2016-06-20 11:18:38 +08:00
明显你连数据库服务器都没启动吧。。。你看看进程?
|
8
jugelizi 2016-06-20 11:18:52 +08:00
删除那个文件
之前也在 linux 下遇到过 |
9
p2p 2016-06-20 11:25:11 +08:00
重启动下 mysql 就完了
|
10
Tony1ee OP @Livid
@izoabr 错误日志: 160620 08:59:13 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var 160620 8:59:13 InnoDB: The InnoDB memory heap is disabled 160620 8:59:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins 160620 8:59:13 InnoDB: Compressed tables use zlib 1.2.8 160620 8:59:13 InnoDB: Using Linux native AIO 160620 8:59:13 InnoDB: Initializing buffer pool, size = 16.0M 160620 8:59:13 InnoDB: Completed initialization of buffer pool 160620 8:59:13 InnoDB: highest supported file format is Barracuda. InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 160620 8:59:13 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... InnoDB: Database page corruption on disk or a failed InnoDB: file read of page 661. InnoDB: You may have to recover from a backup. 160620 8:59:13 InnoDB: Page dump in ascii and hex (16384 bytes): 后面是一堆乱码》》》? 是需要 recover from a backup.吗? 求教下一步怎么办 |
11
ThreeBody 2016-06-20 11:38:37 +08:00 via Android
df 看看是不是空间满了
|
15
izoabr 2016-06-20 11:45:58 +08:00
我记得 innoDB 可以修复的,查查文档
|
16
izoabr 2016-06-20 11:48:30 +08:00
|
17
majunbo 2016-06-20 11:50:41 +08:00
楼主,我周 6 也碰到跟你类似的问题:
Thread pointer: 0x0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0 thread_stack 0x40000 /usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x79e385] /usr/local/mysql/bin/mysqld(handle_fatal_signal+0x403)[0x66e113] /lib64/libpthread.so.0[0x33fc60eca0] /lib64/libc.so.6(gsignal+0x35)[0x33fba30265] /lib64/libc.so.6(abort+0x110)[0x33fba31d10] /usr/local/mysql/bin/mysqld[0x8adda6] /usr/local/mysql/bin/mysqld[0x8993f6] /usr/local/mysql/bin/mysqld[0x817a0f] /usr/local/mysql/bin/mysqld[0x7ccf73] /usr/local/mysql/bin/mysqld[0x8b551b] /usr/local/mysql/bin/mysqld[0x8b5ec4] /usr/local/mysql/bin/mysqld[0x8ab55d] /usr/local/mysql/bin/mysqld[0x7eb525] /usr/local/mysql/bin/mysqld[0x7e05b8] /lib64/libpthread.so.0[0x33fc60683d] 我的解决方案是-----恢复数据库。 |
18
Felldeadbird 2016-06-20 14:39:28 +08:00
Mysql 启动不了来来去去问题就是几点:
1.内存不足。 这个再意外崩溃的情况下导致的。这时候需要重启电脑才可以解决。 2.硬盘空间满了,或者 MYSQL 启动进程的挂载空间满了。 3.其他 剩下的就针对解决就好了。。。 PS :平时弄多几台机器做备份和主从。 MYSQL 崩溃起来 哭爹娘没用。 |
19
zhouquanbest 2016-06-20 15:30:21 +08:00
这么常见的一个问题 你真的只要 stackoverflow 上搜搜就有一堆答案
|