免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6116 | 回复: 15
打印 上一主题 下一主题

cacti+mysql 报错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-02 14:05 |只看该作者 |倒序浏览
cacti+mysql


mysql间隔几分钟就会自动down掉(端口号和进程仍然存在),必须要手动杀掉所有的mysql进程才,然后重启mysql服务才可以正常使用。


FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

[ 本帖最后由 liang3391 于 2009-5-3 16:21 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-05-02 15:45 |只看该作者
建义你贴一下mysql的错误日值。

初步估计是你的max_connect_errors 这个值太小了。
请在my.cnf中
[mysqld]下面添加:
max_connect_error=10240

论坛徽章:
0
3 [报告]
发表于 2009-05-02 23:40 |只看该作者
原帖由 Coolriver 于 2009-5-2 15:45 发表
建义你贴一下mysql的错误日值。

初步估计是你的max_connect_errors 这个值太小了。
请在my.cnf中
[mysqld]下面添加:
max_connect_error=10240



将  max_connect_error 设置的再高,当连接错误数达到这个阈值后,仍然会遇到这个问题。
楼主将错误日志贴出来,分析一下。

论坛徽章:
0
4 [报告]
发表于 2009-05-02 23:59 |只看该作者
原帖由 stormcc 于 2009-5-2 23:40 发表



将  max_connect_error 设置的再高,当连接错误数达到这个阈值后,仍然会遇到这个问题。
楼主将错误日志贴出来,分析一下。

如果那个值也能超过,那只能说明应用程序有问题了。问题很严重了

论坛徽章:
0
5 [报告]
发表于 2009-05-03 01:46 |只看该作者
root@testtt [/usr/local/mysql/var]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=root
Starting mysqld daemon with databases from /usr/local/mysql/var
Killed


mysql log:

090503 13:20:12  mysqld started
/usr/sbin/mysqld: File '/usr/local/mysql/log/mysql.log' not found (Errcode: 13)
090503 13:20:12 [ERROR] Could not use /usr/local/mysql/log/mysql.log for logging                                              (error 13). Turning logging off for the whole duration of the MySQL server proc                                             ess. To turn it on again: fix the cause, shutdown the MySQL server and restart i                                             t.
/usr/sbin/mysqld: File '/usr/local/mysql/log/slowquery.log' not found (Errcode:                                              13)
090503 13:20:12 [ERROR] Could not use /usr/local/mysql/log/slowquery.log for log                                             ging (error 13). Turning logging off for the whole duration of the MySQL server                                              process. To turn it on again: fix the cause, shutdown the MySQL server and resta                                             rt it.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
090503 13:20:12  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
090503 13:20:12  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: File name ./mysql.sock
InnoDB: File operation call: 'stat'.
InnoDB: Error: os_file_readdir_next_file() returned -1 in
InnoDB: directory .
InnoDB: Crash recovery may have failed for some .ibd files!
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
090503 13:20:12  InnoDB: Started; log sequence number 0 184886
090503 13:20:12 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.67-community-log'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Co                                             mmunity Edition (GPL)






090503 01:35:39  mysqld started
090503  1:35:39  InnoDB: Started; log sequence number 0 43655
090503  1:35:39 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.0.40-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
090503  1:37:32 [Note] /usr/local/mysql/libexec/mysqld: Normal shutdown

090503  1:37:34  InnoDB: Starting shutdown...
090503 01:41:12  mysqld started
090503  1:41:12  InnoDB: Started; log sequence number 0 43655
090503  1:41:12 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.0.40-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
090503  1:42:33 [Note] /usr/local/mysql/libexec/mysqld: Normal shutdown

090503  1:42:35  InnoDB: Starting shutdown...
090503 01:43:57  mysqld started
/usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)
090503  1:43:57 [ERROR] Aborting

090503  1:43:57 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete

090503 01:43:57  mysqld ended

090503 01:44:02  mysqld started
090503  1:44:02  InnoDB: Started; log sequence number 0 43655
090503  1:44:02 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.0.40-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution

每间隔几分钟mysql就down掉。但是进程和端口号存在。必须手动把所有mysql进程杀掉,重启采可以启动。


down掉后用 mysql -u root -p 也连不上mysql。


root@testtt [/usr/local/mysql/var]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=root
Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/testtt.com.pid
Killed


安装方式:
mysql-5.0.56

shell> groupadd mysql
     shell> useradd -g mysql mysql
     shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
     shell> cd mysql-VERSION
     shell> ./configure --prefix=/usr/local/mysql
     shell> make
     shell> make install
     shell> cp support-files/my-medium.cnf /etc/my.cnf
     shell> cd /usr/local/mysql
     shell> chown -R mysql .
     shell> chgrp -R mysql .
     shell> bin/mysql_install_db --user=mysql
     shell> chown -R root .
     shell> chown -R mysql var
     shell> bin/mysqld_safe --user=mysql &

[ 本帖最后由 liang3391 于 2009-5-3 14:12 编辑 ]

论坛徽章:
0
6 [报告]
发表于 2009-05-03 16:09 |只看该作者
求助

论坛徽章:
0
7 [报告]
发表于 2009-05-03 16:17 |只看该作者
权限的问题。
chown -R mysql:mysql /usr/local/mysql/

论坛徽章:
0
8 [报告]
发表于 2009-05-03 16:31 |只看该作者

cat /usr/local/mysql/log/error.log

090503 16:25:53  InnoDB: Page checksum 1612628608, prior-to-4.0.14-form checksum                                               2673809632
InnoDB: stored checksum 808464432, prior-to-4.0.14-form stored checksum 80846443                                              2
InnoDB: Page lsn 808464432 808464432, low 4 bytes of lsn at page end 808464432
InnoDB: Page number (if stored to page already) 808464432,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 808464432
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 1.
InnoDB: You may have to recover from a backup.
InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.
InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery                                              .html
InnoDB: about forcing recovery.
InnoDB: Ending processing because of a corrupt database page.
090503 16:25:53  mysqld ended
InnoDB: Crash recovery may have failed for some .ibd files!
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Warning: database page corruption or a failed
InnoDB: file read of page 2.
InnoDB: Trying to recover it from the doublewrite buffer.
InnoDB: Recovered the page from the doublewrite buffer.
InnoDB: Error: page n stored in the page read in is 808464432, should be 1!
090503 16:25:53  InnoDB: Error: page 808464432 log sequence number 808464432 808464432
InnoDB: is in the future! Current system log sequence number 0 193521.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
InnoDB: for more information.
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 1.
InnoDB: You may have to recover from a backup.
090503 16:25:53  InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex 30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
InnoDB: stored checksum 858796848, prior-to-4.0.14-form stored checksum 858796848
InnoDB: Page lsn 858796848 858796848, low 4 bytes of lsn at page end 858796848
InnoDB: Page number (if stored to page already) 858796848,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 858796848
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 1.
InnoDB: You may have to recover from a backup.
InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.
InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
InnoDB: about forcing recovery.
InnoDB: Ending processing because of a corrupt database page.
090503 16:40:52  mysqld ended




root@testtt [~]# cat /usr/local/mysql/log/
error.log      mysql.log      slowquery.log
root@testtt [~]# cat /usr/local/mysql/log/slowquery.log
/usr/local/mysql/libexec/mysqld, Version: 5.0.40-log (Source distribution). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
/usr/local/mysql/libexec/mysqld, Version: 5.0.40-log (Source distribution). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
/usr/local/mysql/libexec/mysqld, Version: 5.0.40-log (Source distribution). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
/usr/local/mysql/libexec/mysqld, Version: 5.0.40-log (Source distribution). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
/usr/local/mysql/libexec/mysqld, Version: 5.0.40-log (Source distribution). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
/usr/sbin/mysqld, Version: 5.0.67-community-log (MySQL Community Edition (GPL)). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
/usr/sbin/mysqld, Version: 5.0.67-community-log (MySQL Community Edition (GPL)). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
/usr/sbin/mysqld, Version: 5.0.67-community-log (MySQL Community Edition (GPL)). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument

[ 本帖最后由 liang3391 于 2009-5-3 16:44 编辑 ]

论坛徽章:
0
9 [报告]
发表于 2009-05-03 16:48 |只看该作者
root@testtt [/usr/local/mysql/var]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=root

mysql 不能以root运行。
现在日值显示,表空间错误,需要恢复。你的数据是不是直接cpoy过来的。而且里有innodb的表。

去查一下innodb怎么迁移的。就可以必免了。

论坛徽章:
0
10 [报告]
发表于 2009-05-03 17:02 |只看该作者
mysql 不以root运行的话  就不能启动。mysql没有做任何处理。这服务器上mysql安装了几次。也没有做数据直接cpoy。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP