plainblack.com Username Password
Click here to register.
| View Cart (0)
download WebGUI now
search  

SQLForm says Databaselink does not have enough privileges  (#3214)
Issue

Trying to add an SQLForm to a page, but receive the following.

Some error(s) occurred:

  • Databaselink does not have enough privileges (Needs ALTER, CREATE, DELETE, INDEX, INSERT, SELECT, UPDATE)

I have checked the database links in admin and added all these as keywords, and ensured that the mysql user has all privileges on the database.

SQLReports are working fine through the same link.

Solution Summary
Comments
colink
0
7/3/2007 11:42 am

In your database, please execute this statement and post the answer back here:

 show grants for current_user

xootom
0
7/3/2007 11:51 am

GRANT USAGE ON *.* TO 'base'@'localhost' IDENTIFIED BY PASSWORD '*xxxxx'

GRANT ALL PRIVILEGES ON `base%`.* TO 'login'@'localhost'

colink
0
7/3/2007 3:34 pm

We'll begin working on the bug.

In the short term, if you change the grants to just base.* instead of base%.*, it should begin working right away.

xootom
0
7/5/2007 10:51 am
Thank you, I have created a new database and login specific to it, which is working.
knowmad
0
7/16/2007 1:41 pm

Colin,

There is a bug in _databaseLinkHasPrivileges() where it does not return a true value if grants are anything but ALL PRIVILEGES. I have attached a patch.

William 

colink
0
7/16/2007 4:09 pm

Fixed in 7.3.21

Note for future privilege bugs.  There is now a test in t/DatabaseLink.t where you can enter in new DSNs or new grant messages and debug them programmatically, rather than trying to setup databases and the like. 

colink
0
7/16/2007 4:13 pm

William,

Thanks for pointing that out.  When I ported the code from the SQLForm to the DatabaseLink, I noticed that, too and have already fixed it.

The relevant svn revs, for reference, are 4359 (for branch/WebGUI_7.3) and 4348-4350, 4358 for HEAD.  The really cool thing is now you can debug these things in a test that regressable so nothing old will get broken as new fixes are added. 

Details
Ticket Status Closed  
Rating0.0 
Submitted Byxootom 
Date Submitted2007-07-03 
Assigned To unassigned  
Date Assigned2009-07-04 
Assigned By 
Severity Critical (mostly not working)  
What's the bug in?  
WebGUI / WRE Version 7.3.19-stable  
URLbugs/tracker/sqlform-says-databaselink-does-not-have-enough-privileges
Keywords
Related Files
Ticket History
© 2009 Plain Black Corporation | All Rights Reserved