You must issue

flush privileges;


to the sql query line.

~K Black

-----Original Message-----
From: alex [mailto:alex@;dynaweb.ru]
Sent: Thursday, October 31, 2002 11:06 AM
To: [EMAIL PROTECTED]
Subject: access denied for user with granted privileges


Hi ppl!

I've got a strange problem.
I've created a user account with access to some concrete database using
GRANT query (see below) but I cannot connect to the server using this
usename only when connecting via mysql_real_connect() from C API. When
using "mysql -u MY_USER" it works fine.

What's wrong?

Initial action is:

  make_scrambled_password(passwd,MY_USER_PASSWD);
  sprintf(query,"grant insert,index,select,update on my_database.* to %s
identified by password '%s'",MY_USER,passwd);
  mysql_query(db,query);

all appropriate records are placed in privilege tables - I checked.

But when trying:


mysql_real_connect(db,"localhost",MY_USER,MY_USER_PASSWD,"my_database",0,"",
0);

I get and error message "Access denied to user MY_USER@localhost (Use
password=YES)"

What's going bad?

Alex




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to