|
|
| Author |
Message |
CPF
Joined: 28 Aug 2005 Posts: 25
|
Posted: Mon Mar 31, 2008 10:25 am Post subject: [SOLVED] Weathermap v0.95b - SELECT command denied |
|
|
Hi
I hope someone can help.
I've just been trying to install the Weathermap plugin for Cacti but I'm getting this error as soon as I add it in to my 'plugins' list in global.php:
SELECT command denied to user 'cactiuser@localhost' for table 'weathermap_maps'
I then can't select anything else in Cacti without getting this error at the top of the screen. The only way to get back to normallity is to comment the plugin out of to the global file.
I'm using the following for my installation:
Windows 2003
Cacti v0.8.7b
Spine v0.8.7a
Plugin Arch v2.1
Php v5.1.4.4
MySQL v5.0.22
Apache v2.0.58
The base Cacti install is working fine and has been for some time. I've actually just made a second instance of our production system, so that I can test this plugin.
Now, this looks like a SQL permissions error, so using the SQL Command Line client, I've tried connecting to this table manually:
C:\Data\Apps\mysql\bin>mysql --user=cactiuser --password cacti-map-test
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 596920 to server version: 5.0.22-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select * from weathermap_maps;
Empty set (0.00 sec)
mysql>
So this looks OK to me (I guess the table is initially empty).
Can anyone make any suggestions as to what may be wrong?
Any help would be much appreciated.
Graham.
| Description: |
|
| Filesize: |
31.97 KB |
| Viewed: |
1280 Time(s) |

|
Last edited by CPF on Tue Apr 01, 2008 4:23 am; edited 2 times in total |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Tue Apr 01, 2008 3:22 am Post subject: |
|
|
| Quote: |
SELECT command denied to user 'cactiuser@localhost' for table 'weathermap_maps'
|
This error is coming from mysql. Check that your cactiuser in mysql is granted the correct permissions to perform a select against the weathermap_* tables. If the user was set up to allow selects ONLY against named tables in the cacti database rather than cacti.*, then you might get this.
|
|
| Back to top |
|
 |
CPF
Joined: 28 Aug 2005 Posts: 25
|
Posted: Tue Apr 01, 2008 3:48 am Post subject: |
|
|
Hi Howie,
Thanks for the quick response.
I did think the same, so I have tried connecting to these tables manually using my Cacti User ('cactiuser'):
| Quote: | C:\Data\Apps\mysql\bin>mysql --user=cactiuser --password cacti-map-test
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 596920 to server version: 5.0.22-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select * from weathermap_maps;
Empty set (0.00 sec)
mysql> |
And again today, I've tried a few more bits such as creating a new user and re-applying the permissions for the database.
I've also tried dropping the weathermap_* tables, and recreating the using my Cacti User account. Works fine from a MySQL perspective, but still getting the same error as before.
Could this be a PHP or MySQL version issue? I'll be the first to admit that mine are a little out of date:
| Quote: | Php v5.1.4.4
MySQL v5.0.22 |
The only reason for holding off on these at the moment, is that this test in running on the same box (just a different instance).
But if you think it could be the issue, then I'll find a way to give it a go.
Thanks again for the advice.
Graham
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Tue Apr 01, 2008 4:02 am Post subject: |
|
|
| CPF wrote: |
Could this be a PHP or MySQL version issue? I'll be the first to admit that mine are a little out of date:
| Quote: | Php v5.1.4.4
MySQL v5.0.22 |
|
I don't think that would be an issue... I know plenty of people still use PHP4 and MySQL 4.0/4.1 even.
More likely would be some mysql setting like strict mode. Or perhaps just try:
| Code: |
grant all on cacti.* to 'cactiuser'@'127.0.0.1' identified by 'jfjfjf';
|
just to be sure. I guess you already did, but if not...
|
|
| Back to top |
|
 |
CPF
Joined: 28 Aug 2005 Posts: 25
|
Posted: Tue Apr 01, 2008 4:21 am Post subject: |
|
|
Thanks Howie,
Solved, but not how I expected...
I've been applying permissions with the MySQL Administrator GUI (yes, sorry, I'm from a Windows World).
This was working fine.
Trying to apply the permissions with the command line client would give me this error:
| Code: | mysql> connect cacti-map-test
Connection id: 615317
Current database: cacti-map-test
mysql> GRANT ALL ON cacti-map-test.* TO cactinewuser@localhost IDENTIFIED BY 'pa
ssword';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '-map-
test.* TO cactinewuser@localhost IDENTIFIED BY 'password'' at line 1
mysql> |
So....
I copied my database over from 'cacti-map-test' to 'cactimaptest', made the appropriate global and config changes.
Then BINGO all is working!
Thanks for pointing me in the right direction. I'll abandon using hypens in the future!
Cheers,
Graham.
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Tue Apr 01, 2008 4:32 am Post subject: |
|
|
Interesting! I'll see if I can tweak the SQL a bit for the next release to defend against that
|
|
| Back to top |
|
 |
|