Page 1 of 1

Privileges Problem

Posted: Fri Jun 13, 2003 4:45 am
by shirokuma
I recently upgraded from MySQL 3.23 to 4.0.13. Everything seemed okay at first but later I noticed that one of my PHP scripts stopped working.

When I display the errors I saw that the account I was using to perform a process was being denied access.

The account is for updating a table. It had update and insert privileges but the error was claiming that it was being denied access to the 'Select' command. This account didn't require the 'select' command under previous versions and the PHP code does not do any selecting. When I granted it 'select' permission is worked. Why would this be?

Below is the code that is being used.

Code: Select all

# update the status for server activity in status tables
function update_status($machine_name, $rpl_last_event)
{
	$db = mysql_connect("localhost","eventloader","eventloader");
	
	mysql_select_db("mimi",$db);
		
	$update="UPDATE status SET rpl_last_event='".$rpl_last_event."'  WHERE machine_name='".$machine_name."'";

	$result = mysql_query($update);

	echo mysql_errno()."\n"; # debug
	echo mysql_error()."\n"; # debug
} # end update_status()
The script is working now but I don't want this account to have select privs. Can someone tell me what's going on here?

I would appreciate any help you can give me.

Thank you,
Paul

Posted: Fri Jun 13, 2003 5:16 am
by cactus
Your previous "mysql" database (the one with all the privs etc and is installed by default) may not have had the mysql_fix_privilege_tables script run against them to fix them to the version 4 features.

Did you run this script?

Regards,