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 > error on connect with a new user

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-10-04, 07:54
eu.rafael eu.rafael is offline
Registered User
 
Join Date: Nov 2004
Posts: 5
error on connect with a new user

First off all, hello from a new user!

Well, I´m trying to login in my db but when I try to conect with one user created by:
GRANT SELECT ON mdb1.* TO USER@"%" IDENTIFIED BY 'U'
the conection don´t work out. ERROR 1045. Doe´s somebody knows why?

Thank´s for your attention,
Rafael.

PS: sorry for my bad english.
Reply With Quote
  #2 (permalink)  
Old 11-10-04, 08:09
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
Did you use
FLUSH PRIVILEGES
after creating the new user?
Reply With Quote
  #3 (permalink)  
Old 11-10-04, 08:24
eu.rafael eu.rafael is offline
Registered User
 
Join Date: Nov 2004
Posts: 5
Quote:
Originally Posted by guelphdad
Did you use
FLUSH PRIVILEGES
after creating the new user?
Yes, I did. Take a look on the prompt execution

mysql> GRANT SELECT, INSERT, DELETE, UPDATE ON mdb1.* TO KHD001@"%" IDENTIFIED BY 'KHD001';
Query OK, 0 rows affected (0.06 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.03 sec)

mysql> exit
Bye

C:\mysql\bin>mysql -u KHD001 -p
Enter password: ******
ERROR 1045 (28000): Access denied for user: 'KHD001'@'localhost' (Using password: YES)

Is there some mistake on my procedure?

Thank´s
Reply With Quote
  #4 (permalink)  
Old 11-11-04, 14:26
eu.rafael eu.rafael is offline
Registered User
 
Join Date: Nov 2004
Posts: 5
Well, i've installed the msql control center and finally solved my problem..... I realised that all user's created with "%". So all user'ss host's are localhost. This is a temporary solution.
Does somebody know´s what´s wrong on
Grant .... to user@"%" ?
Thank's again,
Rafael.
Reply With Quote
  #5 (permalink)  
Old 11-11-04, 14:27
eu.rafael eu.rafael is offline
Registered User
 
Join Date: Nov 2004
Posts: 5
Well, i've installed the msql control center and finally solved my problem..... I realized that all user's created with "%". So all user'ss host's are localhost. This is a temporary solution.
Does somebody know´s what´s wrong on
Grant .... to user@"%" ?
Thank's again,
Rafael.
Reply With Quote
  #6 (permalink)  
Old 11-18-04, 06:27
omiossec omiossec is offline
Registered User
 
Join Date: Jan 2003
Location: Paris, France
Posts: 320
It's because how MySql read the privilege table

When you connect to mysql
Mysql read your username, password and host

So if your are on the server your host is localhost

Mysql will list user with localhost and will find a default user with no privilege
and will chose it

So to enable connection with % on localhost you will need to delete this user

DELETE FROM user WHERE username = '' and HOST = 'localhost'
__________________
Olivier Miossec
--
http://www.lasso-developpeur.net/
--
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