This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
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.
This is no good - we should either remove this feature or make it work correctly.
Discussing with HIE/docs to see if I can remove support for the Grant User feature...
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 http://log4jdbc.sourceforge.net/ 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. Thanks!
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).
Sigh... Thanks.
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.
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.
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?" :)
2864c04e06b0
Integrated into 'main-golden', will be available in build *200811010201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2864c04e06b0 User: David Van Couvering <davidvc@netbeans.org> Log: #149824: Grant full access to user does not seem to work during db creation
jbolter, can You verify with latest build that this issue was really fixed?
He talked to me offline, it's verified.
Yes it is verified, thanks guys!
I've transplanted the changeset http://hg.netbeans.org/main/rev/2864c04e06b0 into release65_fixes repository as http://hg.netbeans.org/release65_fixes/rev/977e8c36470c