标题: 数据库错误Can not connect to database [打印本页] 作者: yanqzh 时间: 2012-4-5 12:21 标题: 数据库错误Can not connect to database 军哥,求救,数据库错误
出现错误!
错误原因:Can not connect to database!
error: Access denied for user 'root'@'localhost' (using password: YES)
请 返 回 并修正
其他网站可以正常连接数据库,且用户名及密码均正确。作者: yanqzh 时间: 2012-4-5 12:29
发现有时如果主站能访问,子站就会出现上面的数据库链接错误;如果主站出现502 bad gateway ,子站就能访问。
[root@li408-51 ~]# ./lnmpa status
=========================================================================
Manager for LNMPA V0.8 , Written by Licess
=========================================================================
LNMPA is a tool to auto-compile & install Nginx+MySQL+PHP+Apache on Linux
This script is a tool to Manage status of LNMPA
For more information please visit http://www.lnmp.org
Usage: /root/lnmpa {start|stop|reload|restart|kill|status}
=========================================================================
Nginx is runing!
/etc/init.d/httpd: line 112: lynx: command not found
SUCCESS! MySQL running (2136)作者: yanqzh 时间: 2012-4-5 12:31
[root@li408-51 ~]# php -v
PHP 5.2.17p1 (cli) (built: Apr 5 2012 03:47:55)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies
[root@li408-51 ~]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful作者: yanqzh 时间: 2012-4-5 12:33
[root@li408-51 ~]# vi /usr/local/mysql/var/li408-51.err
120322 23:03:39 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
120322 23:03:39 [Note] Event Scheduler: Loaded 0 events
120322 23:03:39 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.1.60-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
120322 23:03:40 [Note] /usr/local/mysql/libexec/mysqld: Normal shutdown