FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » ALTER Error Compacting Messages
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
icon5.gif  ALTER Error Compacting Messages [message #4185] Wed, 17 July 2002 19:52 Go to next message
Juanisan is currently offline  Juanisan   United States
Messages: 24
Registered: July 2002
Location: Conshohocken, PA
Karma: 0
Junior Member
I have FUD 2.0.2 installed for weeks now for a private UT clan forum and it works BEAUTIFULLY! Although on an AMD 386/40 Slackware box I had to boost up the PHP timeout for a process to run just for installation Very Happy

Everything works great. Except one day I wanted to, for kicks, try compacting the messages. This is what I got:


Disabling the forum for the duration of maintenance run

Please wait while forum is being compacted.
This may take a while depending on the size of your forum.
Compacting normal messages...
10% done
20% done
30% done
40% done
50% done
60% done
70% done
80% done
90% done
100% done
100% Done
Compacting private messages...

--------------------------------------
Error in function/script: db.inc
has caused the following error: query failed: %( ALTER TABLE fud2_pmsg ADD INDEX(offset) )% because %( Access denied for user: 'badmin@localhost' to database 'barforum' )%
while processing script name: /var/www/htdocs-bar/chat/adm/compact.php
the error occured at: 17/07/2002 19:28:58 GMT
Browser: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1a) Gecko/20020610
User Ip: 10.10.9.1
Script Accessed: /var/www/htdocs-bar/chat/adm/compact.php

Query Failed: ALTER TABLE fud2_pmsg ADD INDEX(offset)
Reason: Access denied for user: 'badmin@localhost' to database 'barforum'
From: /var/www/htdocs-bar/chat/adm/compact.php
Server Version: 3.23.51


Now everything works ok - I just re-enable the forums and it works again. I made sure in MySQL that badmin has ALTER priveleges. I cant interpret this error any other way. Any suggestions?

TIA
Juanisan


Never ask a geek why, just nod your head and slowly back away.
Re: ALTER Error Compacting Messages [message #4186 is a reply to message #4185] Wed, 17 July 2002 19:58 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The problem is clearly lack of ALTER TABLE privelege to the user. It could be that while your setting permit you to run ALTER queries while connecting localy, the user may not have permissions to do so.
You can do a simple test via the following script:
*place the script inside the FORUM's main dir*
<?php
include_once "GLOBALS.php";
fud_use('err.inc');
fud_use('db.inc');

q("ALTER TABLE fud2_pmsg ADD INDEX(offset)");
?>

If you get a query failure then recheck your permissions, otherwise let me know and I'll try to replicate the problem


FUDforum Core Developer
Re: ALTER Error Compacting Messages [message #4187 is a reply to message #4186] Wed, 17 July 2002 20:36 Go to previous messageGo to next message
Juanisan is currently offline  Juanisan   United States
Messages: 24
Registered: July 2002
Location: Conshohocken, PA
Karma: 0
Junior Member
I ran the test....
Called it test.php. This is what I got:

test.php output


--------------------------------------
Error in function/script: db.inc
has caused the following error: query failed: %( ALTER TABLE fud2_pmsg ADD INDEX(offset) )% because %( Access denied for user: 'badmin@localhost' to database 'barforum' )%
while processing script name: /var/www/htdocs-bar/chat/test.php
the error occured at: 17/07/2002 20:37:12 GMT
Browser: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1a) Gecko/20020610
User Ip: 10.10.9.1
Script Accessed: /var/www/htdocs-bar/chat/test.php

Query Failed: ALTER TABLE fud2_pmsg ADD INDEX(offset)
Reason: Access denied for user: 'badmin@localhost' to database 'barforum'
From: /var/www/htdocs-bar/chat/test.php
Server Version: 3.23.51



Mysql Privileges


root@juanisan:~# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7772 to server version: 3.23.51

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select Host,User,Alter_Priv from user;
+-----------+--------+------------+
| Host      | User   | Alter_Priv |
+-----------+--------+------------+
| localhost | root   | Y          |
| juanisan  | root   | Y          |
| localhost |        | N          |
| juanisan  |        | N          |
| %         | badmin | Y          |
| localhost | badmin | Y          |
+-----------+--------+------------+
6 rows in set (0.00 sec)

mysql>



Never ask a geek why, just nod your head and slowly back away.
Re: ALTER Error Compacting Messages [message #4188 is a reply to message #4187] Wed, 17 July 2002 21:00 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
There are other tables that can affect the permissions of user to run an alter query.

Run the following query:

SELECT Alter_priv,User,Db,Host FROM db;


FUDforum Core Developer
Re: ALTER Error Compacting Messages [message #4195 is a reply to message #4188] Wed, 17 July 2002 22:48 Go to previous messageGo to next message
Juanisan is currently offline  Juanisan   United States
Messages: 24
Registered: July 2002
Location: Conshohocken, PA
Karma: 0
Junior Member
The requested query!


mysql> select Alter_priv,User,db,host from db
    -> ;
+------------+------+---------+------+
| Alter_priv | User | db      | host |
+------------+------+---------+------+
| Y          |      | test    | %    |
| Y          |      | test\_% | %    |
+------------+------+---------+------+
2 rows in set (0.00 sec)




So do I have to add my badmin user to this db table?


Never ask a geek why, just nod your head and slowly back away.
Re: ALTER Error Compacting Messages [message #4197 is a reply to message #4195] Wed, 17 July 2002 22:57 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I believe so.

When you use MySQL GRANT command to give user priveleges it actually adds entries to this very table not the users tables. FOr users tables the values by GRANT command are actually set to N.


FUDforum Core Developer
Re: ALTER Error Compacting Messages [message #4332 is a reply to message #4197] Tue, 23 July 2002 23:49 Go to previous message
Juanisan is currently offline  Juanisan   United States
Messages: 24
Registered: July 2002
Location: Conshohocken, PA
Karma: 0
Junior Member
Yuppers - sorry it took so long.

Thanks Prottoss!!

USE [forum database]
GRANT ALL PRIVELEGES ON * TO badmin

and I checked the db database when done - badmin was added.
The compact worked!!!!

Kudos!


Never ask a geek why, just nod your head and slowly back away.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Install issue
Next Topic: Where do I find my forum?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 01 08:14:03 GMT 2024

Total time taken to generate the page: 0.02758 seconds