I apologize if this is somewhere - I couldn't find it in the forum nor in the documentation.
I had originally set my forum up to use the root password, since it was the only thing using MySQL and it was small. Now it's large . I would like to change this to using its own username.
I created a user in MySQL Workbench. I gave it all access to my UBB schema. I then put that user information into the control panel.
When I do, I can see messages, so the connection is made and active. However, it claims there are no forums on the main forum page. When I try to go to a specific post via a URL, it says access denied.
It's odd. I definitely have my new ubblisa user having full rights to the ubb database and tables. There are four logons associated with ubblisa - for 127.0.0.1, ::1, localhost, and the server name. I have found if I take "SUPER" off 127.0.0.1 I get the forums not found error.
So this works -
But if I unclick JUST the SUPER rights on that entry (and remember, the database itself is granted full rights in a separate screen) - I get this -
Put super back on, voila, forums are back.
Without SUPER I can still get to certain areas like messages, so the connection is still there and working.
More details. I went at it from the angle of "what special rights does SUPER grant that this might need".
I then turned on full logs and looked at test runs of looking at the main forum listing with super on vs super off.
I'll note first that without super I *do* get the SET NAMES command that I want. So this is a worthwhile quest, to get a non-SUPER account to use the tables so I can then use the SET NAMES to get my UTF8.
There are TWO differences in the log files.
First: At the end of the healthy run, ubbt_ONLINE gets updated. In the no-Super-access run, that statement is completely absent. I have tested with PHP and the ubblisa account can run that statement. So it's not an access issue.
Second: Before that happens, there is a whole block of SELECTS missing, where it selects from each forum ID and gets the count of posts, sum of posts, and so on. So in the non-SUPER run it goes right from getting the forum title, desc. etc. - skipping over the forum-by-forum queries - and lands right on getting the category title, ID, etc.
So this makes sense. This is why it says there aren't any forums. It never did the selects to get them.
OK, if I stop using the "SET NAMES" command, everything works perfectly with only regular rights. So I can have my ubblisa account work just like Gizmo does, as long as I don't try to use SET NAMES. Unfortunately a key purpose of this project was to be able to use SET NAMES .
When I run just the line in question with SET NAMES, in my test script, it works fine -
Code
SELECT COUNT(p.POST_ID) AS POSTS, SUM(p.POST_IS_TOPIC) AS TOPICS, t.FORUM_ID
FROM ubbt_POSTS as p,
ubbt_TOPICS as t
WHERE (t.TOPIC_ID = p.TOPIC_ID) AND p.POST_IS_APPROVED = 1
AND (0
OR (t.FORUM_ID = 10 AND p.POST_POSTED_TIME > 1328522142)) GROUP BY t.FORUM_ID
So for some reason this code won't run in the live UBB system - it never shows up in the SQL logs. Thoughts on why adding SET NAMES UTF8 would interfere with this section of code not executing? The code right before it - getting the online browsing count - does execute. So something happens before it can then get the forum value. And it only jams if SET NAMES is on.
Note the copyright symbol in the middle of 33(c)_forum=0
Is that really what should be there? It's apparently that mark that is screwing up things once I try to use UTF8 as my language, since it's having problems with it.
I haven't changed forum permissions in ages. Note this row is IN ADDITION to a row for actual forum 33. Forum 33 used to have a slash and & in its title and such. Could these have caused issues for UBB a while back and this has been a historic problem in this table?
In addition to this row there is also this non-numeric row -
Well, I gave in and simply deleted the rows in ubbt_forum_permissions that had the 33(c)_forum=0 as the forum ID.
Voila! I can now "set names" without any error. I now see curly quotes in my forum posts. All of this grief because my forum_permissions table had garbage in it. How did that 33(c)_forum=0 end up in the table?
Hopefully this helps other people who had this issue.
My remaining issue is that the post with the curly quotes will not show UBB properly. You can see this with the top entry here -