[solved] MySQL issue

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
FCFwan
Posts: 2
Joined: Wed Apr 21, 2010 2:04 am

[solved] MySQL issue

Post by FCFwan »

Hello I have a windows environment W2K8 with WAMP installed and a working version of Smokeping with PHP / MySQL / Apache

Apache 2.2.11
PHP 5.3.0
MySQL 5.1.36
Perl 5.8.9

I setup Cacti as good as I can and imported the cacti.sql. PHPmyadmin show a cacti DB with 48 tables. But running the installer always shows me a SQL error.

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

However if I connect from the command line all goes well.

My config.php contains:

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "xxxxx";
$database_port = "3306";

Global.php

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "xxxxx";
$database_port = "3306";

going to the cati website I get:


Deprecated: Function ereg_replace() is deprecated in D:\wamp\www\cacti\include\global.php on line 89

Deprecated: Function ereg_replace() is deprecated in D:\wamp\www\cacti\include\global.php on line 90

Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\cacti\lib\adodb\adodb.inc.php on line 866

Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\cacti\lib\adodb\adodb.inc.php on line 872

Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\cacti\lib\adodb\adodb.inc.php on line 1183

Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\cacti\lib\adodb\adodb.inc.php on line 1961

Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\cacti\lib\adodb\adodb.inc.php on line 3027

Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\cacti\lib\adodb\adodb.inc.php on line 3592

Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\cacti\lib\adodb\adodb.inc.php on line 3667

Deprecated: Assigning the return value of new by reference is deprecated in D:\wamp\www\cacti\lib\adodb\adodb.inc.php on line 3687
FATAL: Cannot connect to MySQL server on '127.0.0.1'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

Why is it not connecting to the MySQL DB???

Who can assist me in this part. I have tried many things but so far so good no luck... I have tried replacing localhost to 127.0.0.1 and doublechecked my password many times.

On the command line I have included the MySQL path so it always can find the mysql.exe running it works great:

D:\>mysql -u cactiuser -p
Enter password: *******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 555
Server version: 5.1.36-community-log MySQL Community Server (GPL)

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

mysql> use cacti;
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_cacti |
+---------------------------+
| cdef |
| cdef_items |
| colors |
| data_input |
| data_input_data |
| data_input_fields |
| data_local |
| data_template |
| data_template_data |
| data_template_data_rra |
| data_template_rrd |
| graph_local |
| graph_template_input |
| graph_template_input_defs |
| graph_templates |
| graph_templates_gprint |
| graph_templates_graph |
| graph_templates_item |
| graph_tree |
| graph_tree_items |
| host |
| host_graph |
| host_snmp_cache |
| host_snmp_query |
| host_template |
| host_template_graph |
| host_template_snmp_query |
| poller |
| poller_command |
| poller_item |
| poller_output |
| poller_reindex |
| poller_time |
| rra |
| rra_cf |
| settings |
| settings_graphs |
| settings_tree |
| snmp_query |
| snmp_query_graph |
| snmp_query_graph_rrd |
| snmp_query_graph_rrd_sv |
| snmp_query_graph_sv |
| user_auth |
| user_auth_perms |
| user_auth_realm |
| user_log |
| version |
+---------------------------+
48 rows in set (0.01 sec)

mysql>

Apache path:
D:\wamp\bin\apache\Apache2.2.11
MySQL path:
D:\wamp\bin\mysql\mysql5.1.36
PHP path:
D:\wamp\bin\php\php5.3.0
Cacti path:
D:\wamp\www\cacti
Perl:
D:\perl


Cheers..
User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

Post by Sirup »

The deprectad warnings are a result of using PHP 5.3. Further information: http://docs.cacti.net/faq#deprecated_warnings

I had the same issue - "FATAL: Cannot connect to MySQL" - (see: http://forums.cacti.net/viewtopic.php?t ... c&start=15) when installing cacti - but on Linux. I also was completely the credentials in the php-files were correct.
Maybe some hints from this thread can help you - even if they are from Linux.

What I did is like "nothing". I just rechecked my settings, rebooted... nothing special and one morning it just worked - Sorry for not helping you in a better way. =/
FCFwan
Posts: 2
Joined: Wed Apr 21, 2010 2:04 am

Solved

Post by FCFwan »

I removed WAMP 2.0i and installed WAMP 2.0h and added php 5.2.11
Now all works fine.

Although I had to add the MIBS for SNMP and manualy set the PHP ini file to add socks support as the WAMP tool is changing the wrong ini file.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest