Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 149824 - Grant full access to user does not seem to work during db creation
Grant full access to user does not seem to work during db creation
Product: db
Classification: Unclassified
Component: MySQL
Macintosh All
: P2 (vote)
: 6.x
Assigned To: David Vancouvering
Depends on:
  Show dependency treegraph
Reported: 2008-10-10 22:27 UTC by jbolter
Modified: 2008-12-11 22:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description jbolter 2008-10-10 22:27:33 UTC
I have tested this on MacOS X 10.5 and Windows XP in Virtual Box using the 6.5 nightly build (200810080201).  Here are
the steps I take.

Connect to the MySQL database as root.  This works fine.  I see all the databases.  I create a user using a SQL
statement, works fine, i see the new user in the mysql.user table.  Now I right click the MySQL Server and choose Create
Database. I enter the new database name and check the box to Grant Full Access To: phpuser@localhost.  The database gets
created but I do not have any permissions for phpuser@localhost.  The connection is opened as root which works fine but
the permissions for phpuser@localhost are never added to the mysql.db table.
Comment 1 David Vancouvering 2008-10-15 01:04:25 UTC
This is no good - we should either remove this feature or make it work correctly.
Comment 2 David Vancouvering 2008-10-29 19:28:18 UTC
Discussing with HIE/docs to see if I can remove support for the Grant User feature...
Comment 3 David Vancouvering 2008-10-30 21:10:14 UTC
I just tried this and it worked fine for me as davidvc@localhost.  I did a select of mysql.db where db = 'test' and I
saw myself there, with all privileges.

Here is the command I send to the server:

GRANT ALL ON dbname.* TO ?.?

and then substitute the two parameters for the user name and host name derived from the drop-down.

I wonder what's different.  What version of MySQL are you using?  I am using 5.0.41 on Mac.

I can't seem to find any mention of any way to log the SQL being sent to the MySQL server.  There is a logging JDBC
driver at that we could use to see what exactly is being sent if necessary...

Can you please try again and describe the exact steps you are using? Then remove the INCOMPLETE keyword as I filter out
issues marked as incomplete.

Comment 4 jbolter 2008-10-30 23:40:15 UTC
I tried it again thinking that maybe the issue was because I have a blank root password. So I set a root password and
tried again and still did not get the result I was hoping for.  Here are the exact steps I took.

Go to Services window.
Right click MySQL server, choose Connect.
Right click MySQL server again, choose Create Database.
Enter database name 'testdb' and check box to grant full permission to: selected phpuser@localhost.
Click OK.
Database is created and NB makes a connection using the root account.
If I view mysql.db I do not see any permissions for phpusers@localhost for database testb.
Just to make sure I try to create a connection using the phpuser account and it fails to authenticate.

I am using NB RC1, Mac OS 10.5, and MySQL Server version: 5.0.51b MySQL Community Server (GPL).

Comment 5 David Vancouvering 2008-10-31 00:03:49 UTC
Sigh... Thanks.
Comment 6 David Vancouvering 2008-10-31 00:25:16 UTC
That's weird.  I just tried it again, using the database name 'newdb' and this time when I did a 'select * from
mysql.db' the database 'newdb' wasn't even there.  But of course it is there because I'm connected to it.  I did try to
connect as davidvc and it failed, although I was able to connect as root.

What's even stranger is that there are databases in mysql.db that I deleted long ago.

Then I did a "grant all on newdb.* to davidvc@localhost" and executed that and then I was able to connect.

So now I'm very confused.
Comment 7 David Vancouvering 2008-10-31 00:27:27 UTC
Oh, I get it, if nobody but root has privileges on a table, then it doesn't show up in mysql.db.  mysql.db is a
privileges table, it's not the metadata for the table definition itself.

So, I guess I just got lucky this time, now I can reproduce and I will investigate.
Comment 8 David Vancouvering 2008-10-31 23:04:09 UTC
Well, it would help if we actually *called* the method to grant access to the user. Doh!  The programming equivalent of
"is it plugged in?" :)
Comment 9 David Vancouvering 2008-10-31 23:34:30 UTC
Comment 10 Quality Engineering 2008-11-01 05:13:54 UTC
Integrated into 'main-golden', will be available in build *200811010201* on (upload may still be in progress)
User: David Van Couvering <>
Log: #149824: Grant full access to user does not seem to work during db creation
Comment 11 Roman Mostyka 2008-11-05 20:01:40 UTC
jbolter, can You verify with latest build that this issue was really fixed?
Comment 12 David Vancouvering 2008-11-05 20:52:52 UTC
He talked to me offline, it's verified.
Comment 13 jbolter 2008-11-05 20:59:10 UTC
Yes it is verified, thanks guys!
Comment 14 rbalada 2008-11-18 13:47:32 UTC
I've transplanted the changeset into release65_fixes repository as

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo