MySQL Permition creation problem ...

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Hi,

I'm trying to define some basic permitions on MySQL with no success ...

I'm using MySQL 4.1.11 on Windows XP Pro. I'm using MySQL Administrator 1.0.20 to configure all up, still no success.

What I want:

I want to configure 2 schemas. One named www and other named docj. Names aren't important, these ones were randomly taken from my head :).

So I want to create a user, djuser which will be able to do Select/Insert/Updete/Delete on docj only.

If I try to enter with that user, I would only be able to access the docj schema, and all it's tables. This would be some sort of user for an application to access the database.

The problem, is that no matter what I do, I cannot make it to work ... I can't even login with the user I just created ... but mysql is working, since I can login with the user admin.

Once I did made it with success, a couple of months ago, but didn't exacly knew how I made it ... just happened ... :)

I'll post some pictures with the definitions I made in the Administrator tool. I'm using MySQL Query Browser 1.1.7 to access the database. All this software's are lattest versions taken from the mysql site.

User Definitions

User Privileges for docj schema

User Privileges for www schema

Failed Login

Before you send me googling around, let me tell you I'm already googling for some solution for this problem, and still haven't found a clear explanation ... the question is, why isn't it working? What am I missing? Some crazy refresh missing here?

I don't believe it's a bug, because it happened to me before as I said, with an older version of MySQL.


Thanks for any help :)
 

Cerebus451

Golden Member
Nov 30, 2000
1,425
0
76
MySQL stores user privileges based on "user@host". Adding a user to the database doesn't grant that user privilege to log in from any host, only the specific host that is used (NOTE: you can wildcard the host name, and using '%' as the host name would infact grant the user the ability to log in from any host). In your failed login message, it is failing for user "docj" on host "localhost". I am not familiar with MySQL Administrator. The screens only allow you to enter user names, not host names, so I don't know what it is putting into the users table on mysql. It might be inserting the actual machine name instead of 'localhost' and so the login will fail. Log in to the database through the command-line SQL tool using the master username/password that you set up and look at the table user in the database mysql. Pay particular attention to the "Host" column. If it doesn't contain '%' or 'localhost' for your users then that is the issue.
 

b4u

Golden Member
Nov 8, 2002
1,380
2
81
But I not only added the user, but gave him Select/Insert/Update/Delete permitions on a schema ... so it should be working, right?

One more screen:

User Table on MySQL Schema

Here I can see there are no permitions for select/insert/update/delete, but the host is defined as % ... so I should be able to login ...

Have no idea! :(
 

Wizkid

Platinum Member
Oct 11, 1999
2,728
0
0
try running this SQL statement:

flush privileges;

Make sure that you are typing your password with the correct case. That's about all I can think of.