Last modified: 2008-04-17 19:23:19 UTC
I just installed the latest release tarballs of Mediawiki and semantic mediawiki, but so far I'm unable to get any results from it. When I use #ask to query a category, I get the following: --- A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "". MySQL returned error "1142: ALTER command denied to user 'wikiuser'@'localhost' for table 'cats1' (localhost)". --- I ran the installation special page, but there is no cats1 table in this database.
Similar results when querying on a property: A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "". MySQL returned error "1142: ALTER command denied to user 'wikiuser'@'localhost' for table 'prop1' (localhost)".
Created attachment 4767 [details] workaround to get this at least semi-functional Sorry to keep spamming this, I was really hoping this would be a bit easier to get working. Anyway, I seem to have found a workaround for this problem, so the extension may be usable. The first change seems innocuous. Hopefully the second set of lines I commented out weren't important, and there aren't many more problems like this. Thanks.
AFAIK, SMW creates temporary tables to process certain queries, therefor it needs the following additional rights: * CREATE TEMPORARY TABLE * DROP TEMPORARY TABLE * ALTER TABLE Unfortunately, this does not seem to be documented in INSTALL. Retitling bug accordingly.
Thanks for the clarification; yes, that would've been helpful if it were documented. Currently, mine does seem to be working without these rights, so it may be possible to simplify it somewhat. i.e. it only alters a table immediately after creation, so that can be changed. although the installation may still be complicated enough that we'd want something like mediawiki's config.php script to initialize things.
Created attachment 4825 [details] Update INSTALL Adding patch to update INSTALL. I've looked over the SQL Store for SMW, and it definitely needs these permissions to fully function. I'm not sure your patch really *fixes* things so much as it hides the errors.
Strangely, my MySQL doesn't seem to understand syntax like "grant drop temporary table". The only place I see an alter table is immediately after creation, so I just combined those statements (r33392) and did a "grant drop table". I haven't seen any problems with just commenting out the drop table, but I'm sure they must be there. Although I'd guess changing "create table" to "create table unless exists" and "drop table" to "delete from table" should work. Or if there is a common syntax to grant privs on temporary tables, maybe that could be added to the setup script.
(In reply to comment #6) > Strangely, my MySQL doesn't seem to understand syntax like "grant drop > temporary table". > > The only place I see an alter table is immediately after creation, so I just > combined those statements (r33392) and did a "grant drop table". I haven't > seen any problems with just commenting out the drop table, but I'm sure they > must be there. Although I'd guess changing "create table" to "create table > unless exists" and "drop table" to "delete from table" should work. Or if > there is a common syntax to grant privs on temporary tables, maybe that could > be added to the setup script. > sorry, that was r33393.
I have now updated INSTALL as suggested, and added a further remark how to disable the features that need those additional user rights. ALTER TABLE may still be required for updates (if the DB layout changed).