|
Re: ALTER Error Compacting Messages [message #4186 is a reply to message #4185] |
Wed, 17 July 2002 19:58 |
Ilia
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 |
Juanisan
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 |
Ilia
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 |
Juanisan
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 |
Ilia
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 |
Juanisan
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.
|
|
|