DataBase error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

DataBase error

Post 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

User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: DataBase error

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: DataBase error

Post by abrist »

Did you also specify where the socket file should be located in my.cnf?

Code: Select all

[mysqld]
socket=/path/to/socket
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked