Licia Licia - 13 days ago 11
MySQL Question

ERROR 1045 (28000): Access denied for user (using password: YES)

I am trying to have a simple mysql Database on a server and another database on another server that connects to it.

I have done the following :


  1. Installed mysql-server

  2. Created the database

  3. Created the user with :

    CREATE USER admin@'localhost' IDENTIFIED BY 'admin';

  4. Given the privileges to this user with :

    GRANT ALL PRIVILEGES ON confWeb.* TO admin@'';

  5. Opened the bind-adress



Now when I launch the command
mysql -u admin -p -h <address>
from another server, it just tells me again and again :

ERROR 1045 (28000): Access denied for user 'admin'@'X.X.X.X' (using password: YES)


I really have no idea what to do at this point. I think I've tried everything.
I tried putting
GRANT OPTION
in the end of the GRANT line, I tried allowing a lot of different addresses but nothing worked.

Answer

I do not really know why, but appareantly, it worked when I used the with grant option and first gave access to the database, and then to its tables. Here is the list of commands that I entered :

mysql> create user 'admin'@'localhost' identified by 'admin';
mysql> grant all privileges on confWeb to 'admin'@'10.69.101.%' identified by 'admin' with grant option;
mysql> grant all privileges on confWeb.* to 'admin'@'10.69.101.%' identified by 'admin' with grant option;
mysql> flush privileges;

Again, I don't really know why it didn't work before and the answers that I saw look like all the documentation I have seen but it looks my problem was somewhere else.

Comments