Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2004
    Posts
    5

    Unanswered: 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.

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    Did you use
    FLUSH PRIVILEGES
    after creating the new user?

  3. #3
    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

  4. #4
    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.

  5. #5
    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.

  6. #6
    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/
    --

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •