If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Weird : -- ERROR 1044 (42000): Access denied for user: 'abc'@'%' to database 'Toucan'

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-04, 14:22
Toucan Toucan is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
Exclamation Weird : -- ERROR 1044 (42000): Access denied for user: 'abc'@'%' to database 'Toucan'

Hi

I am getting the error
ERROR 1044 (42000): Access denied for user: 'abc'@'%' to database 'Toucan' after restarting server, but I don't understand why.

I use linux RPM MySQL-server-4.1.1-1


** First, I log on as root, I create a user with the Grant command and I give him access to table EntreeTemps in database Toucan

mysql --user=root --password=myrootpassword
use Toucan;
GRANT SELECT ON EntreeTemps TO abc IDENTIFIED BY 'def';
FLUSH PRIVILEGES;
EXIT

** Then, I reconnect to the database, using my new user

mysql --user=abc --password=def
use Toucan;
SELECT * FROM EntreeTemps;

** So far, everything works very well, I am able to obtain my data.


** BUT ...

** Then, if I restart the MySQL Server daemon (I restart the service) and I connect with this line :

mysql --user=abc --password=def

** so far ok...

use Toucan;

** THEN I get the ERROR 1044 (42000): Access denied for user: 'abc'@'%' to database 'Toucan'. I am unable to use the database Toucan !!!

** It used to work with the previous version, the 4.1.0-0

** Any clue why this happens??? I have the feeling the system doesn't read the table tables_priv where the granted privileges are stored ...

Last edited by Toucan; 02-11-04 at 14:36.
Reply With Quote
  #2 (permalink)  
Old 02-11-04, 17:36
aus aus is offline
Registered User
 
Join Date: Oct 2003
Location: Denver, Colorado
Posts: 137
Re: Weird : -- ERROR 1044 (42000): Access denied for user: 'abc'@'%' to database 'Tou

I ran similar permissions on my machine (same MySQL version) and got access denied errors as well. I then tried to connect from another machine and got in. What allowed me to be able to connect from the local machine was to grant the user abc@localhost the same privileges:
Code:
+-----------------------------------------------------------------------------------+
| Grants for abc@localhost                                                          |
+-----------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'abc'@'localhost' IDENTIFIED BY PASSWORD '7b16b68b22ae3ab6' |
| GRANT SELECT ON `toucan`.`entreetemps` TO 'abc'@'localhost'                       |
+-----------------------------------------------------------------------------------+
Reply With Quote
  #3 (permalink)  
Old 02-12-04, 09:10
Toucan Toucan is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
No, that's not the problem ...

Quote:
Originally posted by aus
I ran similar permissions on my machine (same MySQL version) and got access denied errors as well. I then tried to connect from another machine and got in.
Well, this is not the case for me. I tried to connect from remote machine, and I got the same result. I tried the code you suggested me, but it gave me no result. - I insist on the fact that I needed to restart the MySQL server daemon to get the problem.

I granted rights on a specific table of the database (recorded in tables_priv), but I didn't grant rights on the database itself specifically.

When I call the command "use Toucan", I though the server checks the mysql.db table, and if record is not found, then checks in mysql.tables_priv. It did in previous version. But now, it seems that it only checks the "mysql.db" table, so the granted rights I granted on EntreeTemps are ignored...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On