Possible mysql error

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
sheds
Posts: 11
Joined: Fri Apr 06, 2007 4:08 pm
Location: ???????????????

Possible mysql error

Post by sheds »

Hey, new here with cacti.

The problem shows up when accessing http://localhost/cacti that i get that error as if there is nothing inside the database or that the permissions have not been set up correctly. I assume php is working and that apache is up cause that seems to be an error accessing mysql, not that apache can't process php or that apache is not running. To check, i typed http://localhost to see if apache is running, which it is. How can i verify that php is working properly with apache? Judging by the error message, i think it's gotta do for some strange reason with mysql, or with the cacti config. I have checked and rechecked and redone everything and i still can't get it to run. I do see the tables that the cacti.sql script created. So the error makes no sense; further down, i put what i did to check the permissions for the cacti user inside mysql. Here's the error:

Code: Select all

Error

You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:
mysql -u cacti -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.
Also, to double check, i performed the following command from within mysql to see the grants on user cacti:
show grants for 'cacti'@'localhost';
This command yielded the following output:
+--------------------------------------------------------------------------------------------------------------+
| Grants for cacti@localhost |
+--------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'cacti'@'localhost' IDENTIFIED BY PASSWORD '*8793F1AC6B77776A6642859EA37CD6C1446D01D3' |
| GRANT ALL PRIVILEGES ON `cacti`.* TO 'cacti'@'localhost' WITH GRANT OPTION |
+--------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

This certainly looks right! So i don't know why it's not working.

Thanks for the help.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

What version of mysql? Is strict mode enabled? If it is, disable it and then re-create the database and re-import the schema.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
sheds
Posts: 11
Joined: Fri Apr 06, 2007 4:08 pm
Location: ???????????????

Post by sheds »

Thanks for the reply.

I altered /etc/php.ini to include 'extension=mysql.so', then restarted httpd. I am getting a blank screen now. Let me research and learn what strict mode does and how to disable it. I've never heard of that before. Also, the version i have installed is 5.0.37.

I'll get back to you soon.
sheds
Posts: 11
Joined: Fri Apr 06, 2007 4:08 pm
Location: ???????????????

Post by sheds »

Well, that didn't help, that was disabled already and i still get the blank page on my browser when going to http://localhost/cacti. Don't i need to put some entry in apache so that the index.php is displayed? Not just the address on the address bar? I ask because the manual to install cacti is very very simple. I didn't expect as many problems as i have. :(
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This problem has been experienced by others on the board. It is likely something quite simple. You are running the j version right?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
sheds
Posts: 11
Joined: Fri Apr 06, 2007 4:08 pm
Location: ???????????????

Post by sheds »

TheWitness wrote:This problem has been experienced by others on the board. It is likely something quite simple. You are running the j version right?

TheWitness
j version of mysql or cacti? I have to clarify that i haven't even got to the part where cacti asks for the admin username and password. Just in case someone was wondering in which step i am.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Do the following:

mysql cacti
> show tables;

Post your output.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
sheds
Posts: 11
Joined: Fri Apr 06, 2007 4:08 pm
Location: ???????????????

Post by sheds »

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.00 sec)
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

What version of PHP? If not 5, upgrade. You have a database connectivity problem. Look for the "old_password" trick otherwise.

TheWitness

ps. I just downgraded to php4.x and had the same issue. As you can see, it's been a while.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
sheds
Posts: 11
Joined: Fri Apr 06, 2007 4:08 pm
Location: ???????????????

Post by sheds »

Hey dudes.
Out of common sense, i decided to check the logs when restarting apache, httpd. Here's the output: ( i can tell there are errors, jajja)

Code: Select all

<b>Warning</b>:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/msql.so' - /usr/lib/php/modules/msql.so: cannot open share
d object file: No such file or directory in <b>Unknown</b> on line <b>0</b><br />
[Mon Apr 09 14:45:51 2007] [notice] caught SIGTERM, shutting down
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/msql.so' - /usr/lib/php/modules/msql.so: cannot open share
d object file: No such file or directory in <b>Unknown</b> on line <b>0</b><br />
[Mon Apr 09 14:45:52 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Apr 09 14:45:53 2007] [notice] Digest: generating secret for digest authentication ...
[Mon Apr 09 14:45:53 2007] [notice] Digest: done
[Mon Apr 09 14:45:53 2007] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Mon Apr 09 14:45:53 2007] [notice] LDAP: SSL support unavailable
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/msql.so' - /usr/lib/php/modules/msql.so: cannot open shared o
bject file: No such file or directory in Unknown on line 0
[Mon Apr 09 14:45:53 2007] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Mon Apr 09 14:45:53 2007] [notice] Apache/2.0.54 (Fedora) configured -- resuming normal operations
Can you help solve the mysql.so problem that php seems to have? I remember removing the ; comment from php.ini for that mysql.so line, but not sure if that's all i gotta do.

Ok, i just created a test.php file with the phpinfo(); function. The test page displayed all the info including the version, which is 5.0.4. Is there another 5. something version i should be using? Or is this one enough? I guess this shows that the apache-php combo is working properly.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please verify, that /etc/php.ini contains

Code: Select all

; Enable mysql extension module
extension=mysql.so
either directly or via php.d/mysql.ini. Restart httpd, then.
Reinhard
sheds
Posts: 11
Joined: Fri Apr 06, 2007 4:08 pm
Location: ???????????????

Post by sheds »

Hey, i created a test.php file to display the output of phpinfo();. I noticed that inside the configure commands, there are a couple of options that leave mysql out of php. Is this why php is not working with mysql? Here's the output, having the part i am talking about in red and bold.

./configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba'

If this is so, how do i recompile php to add mysql support? I think i just have to run ./configure from where php is, but i can't find where php is located on my machine, or where to perform the ./configure --with-mysql and --with-gd. Please don't leave out any steps for i am now kinda lost since i've been going back and forth on a million things to get this working.

So many thanks in advanced.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests