My Nagios can't contect with MySQL! Need you help!!!

Silence Wang silence.wang at ilink.net
Mon Feb 24 05:01:27 CET 2003


Dear all,
       I have compiled Nagios with MySQL support. And created a database named "nagios" with tables as same as the scripts in contrib/database/create_mysql in MySQL database. I also have add the directives as below in cgi.cfg  and resource.cfg:
<IN cgi.cfg>       xrddb_host=localhost 
                          xrddb_port=3306
                          xrddb_database=nagios
                          xrddb_username=root
                          xrddb_password=XXXXXXXX
                          
                          xdddb_host=localhost
                          ...............................
                          xcddb_host=localhost
                          ...............................
                          xsddb_host=localhost
                           ..............................
                          xeddb_host=localhost
                          ...............................
 
<IN resource.cfg>            xrddb_host=localhost
                                        xrddb_port=3306
                                        xrddb_database=nagios
                                        xrddb_username=root
                                        xrddb_password=XXXXXXXX
                                        xrddb_optimize_data=1
 
                                        xdddb_host=localhost
                                          ...............................
                                        xcddb_host=localhost
                                          ...............................
                                        xsddb_host=localhost
                                         ..............................
                                        xeddb_host=localhost
                                         ...............................

I can connect to MySQL with this kind of command:
 shell# mysql -h localhost -P 3306 -u root --password=XXXXXX nagios
 
BUT!!!!!!When start Nagios, there is always this Error:
Error: Could not connect to MySQL database 'nagios' on host 'localhost' using username 'root' and password 'XXXXXXXXX'.  Status data will not be saved!
Error: Could not re-connect to database server on host 'localhost' for status data.  I'll keep trying every 60 seconds...
Error: Could not connect to MySQL database 'nagios' on host '' using username 'root' and password 'XXXXXXX' for comment data!
Error: Could not connect to MySQL database 'nagios' on host '' using username 'root' and password 'XXXXXXX' for downtime data!
       
       Here is some detail of my Nagios server:
       Operation System:    RedHat7.3
       Nagios Version:        1.0
       Nagios Plugin Version:       1.3.0-beta3
       MySQL Version:       Ver11.18 Distrib 3.23.55, for pc-linux (i686)
 
        I need your help!!!Thanks a lot!!!
Silence


More information about the Users mailing list