Access denied for user 'root'@'%' (using password: YES) but logged in as root

brocky34

I'm aware there are similar questions all over the web, but I can't find anything for this particular issue. I have C# experience, but am pretty new to MySQL, so perhaps there's something I'm not understanding. I'm trying to make a simple select in C# from a MySQL table:

            string server = "192.168.2.6";
            string database = "productintegration";
            string uid = "root";
            string password = "Password1";
            string connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

            MySqlConnection connection = new MySqlConnection(connectionString);

            string query = "select * from tcdidataimport";

            connection.Open();
            MySqlCommand cmd = new MySqlCommand(query, connection);
            MySqlDataReader dataReader = cmd.ExecuteReader();
            DataTable dt = new DataTable();

            if (dataReader.HasRows)
            {
                dt.Load(dataReader);
            }
            connection.Close();

And I get the following exception:

Authentication to host '192.168.2.6' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'JUSTINSPERSONAL' (using password: YES)

Seems simple enough... Except that I'm already connecting to that server (via MySQL Workbench) using that exact login.

Here is show grants;

enter image description here

Which seems to me that I should be able to log in using root at whatever I want? When I tried to create another user (CDISelector@'%') and grant privileges I got a similar error:

enter image description here

But I'm logged in as root? Am I missing something here? Finally, here's the results of select user(), current_user();

enter image description here

JUSTINSPERSONAL is my PC, 192.168.2.6 is the MySQL machine's IP. Not sure what I'm missing here but this all seems a little strange.

brocky34

And it turns out I had the password incorrect. Ha.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Access denied for user 'root'@'localhost' (using password: YES)

From Java

Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?

From Dev

OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

From Dev

error: 'Access denied for user 'root'@'localhost' (using password: YES)'

From Dev

OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

From Dev

Access denied for user 'root'@'localhost' (using password: Yes) after password reset LINUX

From Dev

Access denied for user 'root'@'localhost' (using password: NO);

From Java

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

From Dev

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

From Dev

ajax with jsp and mysql : java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

From Dev

PyCharm - Database connection. Access denied for user 'root'@'localhost' (using password: YES)

From Dev

Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES)

From Dev

Php Post Insert Error Access denied for user 'root'@'localhost' (using password: YES)

From Dev

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) symfony2

From Dev

Laravel Access denied for user 'root'@'localhost' (using password: YES) in laravel 4.2

From Dev

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

From Dev

Locall MySQL DB login Error : Access denied for user 'root'@'localhost' (using password: YES)

From Dev

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) symfony2

From Dev

lavaral 5 ERROR{ (SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)}

From Dev

c3p0 access denied for user 'root'@'localhost' (using password yes)

From Dev

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) after set plugin = ''

From Dev

Brew mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

From Dev

Unable to access MySQL from C# application because of Exception: "Access denied for user 'root'@'localhost' (using password: YES)"

From Dev

rails db:migrate rails aborted! Mysql2::Error: Access denied for user 'root'@'localhost' (using password: YES)

From Dev

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

From Dev

OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

From Dev

MySQL Access denied for user 'User'@'localhost' (using password: YES)

From Java

Access denied for user 'homestead'@'localhost' (using password: YES)

From Dev

1045, "Access denied for user 'username'@'NOT-local' (using password: YES)"

Related Related

  1. 1

    Access denied for user 'root'@'localhost' (using password: YES)

  2. 2

    Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?

  3. 3

    OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

  4. 4

    error: 'Access denied for user 'root'@'localhost' (using password: YES)'

  5. 5

    OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

  6. 6

    Access denied for user 'root'@'localhost' (using password: Yes) after password reset LINUX

  7. 7

    Access denied for user 'root'@'localhost' (using password: NO);

  8. 8

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

  9. 9

    java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

  10. 10

    ajax with jsp and mysql : java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

  11. 11

    PyCharm - Database connection. Access denied for user 'root'@'localhost' (using password: YES)

  12. 12

    Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES)

  13. 13

    Php Post Insert Error Access denied for user 'root'@'localhost' (using password: YES)

  14. 14

    SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) symfony2

  15. 15

    Laravel Access denied for user 'root'@'localhost' (using password: YES) in laravel 4.2

  16. 16

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

  17. 17

    Locall MySQL DB login Error : Access denied for user 'root'@'localhost' (using password: YES)

  18. 18

    SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) symfony2

  19. 19

    lavaral 5 ERROR{ (SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)}

  20. 20

    c3p0 access denied for user 'root'@'localhost' (using password yes)

  21. 21

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) after set plugin = ''

  22. 22

    Brew mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

  23. 23

    Unable to access MySQL from C# application because of Exception: "Access denied for user 'root'@'localhost' (using password: YES)"

  24. 24

    rails db:migrate rails aborted! Mysql2::Error: Access denied for user 'root'@'localhost' (using password: YES)

  25. 25

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

  26. 26

    OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

  27. 27

    MySQL Access denied for user 'User'@'localhost' (using password: YES)

  28. 28

    Access denied for user 'homestead'@'localhost' (using password: YES)

  29. 29

    1045, "Access denied for user 'username'@'NOT-local' (using password: YES)"

HotTag

Archive