Page 1 of 1

DataBase error

Posted: Tue Sep 16, 2014 10:04 am
by sarfarosh
Hello Guys,

I have relocated mysql DB from /var/lib/mysql to /mysql/ and made necessary changes in /etc/my.cnf. every thing is working fine i am able to connect to the DB,

Code: Select all

[root@Synoptics-VM01 scripts]# mysql -h localhost  -u ndoutils -pn@gweb nagios
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q
Bye
but when i try to access dashboard it gives DB error,
tail -f /var/log/httpd/error_log says:

Code: Select all

[root@Synoptics-VM01 ~]# tail -f /var/log/httpd/error_log
[Tue Sep 16 20:33:32 2014] [error] [client ::1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Tue Sep 16 20:33:32 2014] [error] [client ::1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Tue Sep 16 20:33:32 2014] [error] [client ::1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Tue Sep 16 20:33:32 2014] [error] [client 49.248.31.218] PHP Warning:  simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://103.230.84.24/nagiosxi/index.php?
[Tue Sep 16 20:33:32 2014] [error] [client 49.248.31.218] PHP Warning:  simplexml_load_string(): Message: A database connection error has been detected, we are attempting to rep in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://103.230.84.24/nagiosxi/index.php?
[Tue Sep 16 20:33:32 2014] [error] [client 49.248.31.218] PHP Warning:  simplexml_load_string(): ^ in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://103.230.84.24/nagiosxi/index.php?
[Tue Sep 16 20:33:32 2014] [error] [client 49.248.31.218] PHP Notice:  Undefined variable: count in /usr/local/nagiosxi/html/includes/utils-xmlstatus.inc.php on line 954, referer: http://103.230.84.24/nagiosxi/index.php?
[Tue Sep 16 20:33:41 2014] [error] [client ::1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Tue Sep 16 20:33:42 2014] [error] [client ::1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383


Re: DataBase error

Posted: Tue Sep 16, 2014 5:08 pm
by lmiltchev
Can you run the following commands and show us the output?

Code: Select all

ll -d /mysql
ll /mysql
cat /etc/my.cnf

Re: DataBase error

Posted: Tue Sep 16, 2014 5:10 pm
by abrist
Did you also specify where the socket file should be located in my.cnf?

Code: Select all

[mysqld]
socket=/path/to/socket