1

I created a user when i created my sql database, the database is hosted on cloudcluster.io I gave the user permission to perform all tasks. I than successfully created a user using the admin user while connecting remotely to the database from my local machine no problem. I have a flask app which i than connect to the cloudcluster database. I create a user, but when i try to grant the user any permissions I get the following error.

ERROR 1045 (280000): Access denied for user 'username'@'%' (using password: YES)

But when i view users and hosts i can the following table

+---------------+-----------+
| USER          | HOST      |
+---------------+-----------+
| username      | localhost |
| mysql.session | localhost |
| mysql.sys     | localhost |
| root          | localhost |
+---------------+-----------+

I really don't understand why it's referencing 2 hosts. Any insight would go a long way

  • 2
    I think the `@'%'` bit is a clue. That's not "localhost". https://dba.stackexchange.com/questions/38803/mysql-error-1045-28000-access-denied-for-user – Martin Burch Jul 03 '20 at 14:51
  • Just to clarify, if a create a user remotely where i have access and host the user on the same server as where my flask app is hosted, i will have access? – Thembekile Mkhombo Jul 03 '20 at 15:38
  • Did the answer help? I think it's all about the connection string you use, not exactly where the server is located in relation to the app, although for true "localhost" the database and flask app would have to be on the same server. – Martin Burch Jul 03 '20 at 17:08

0 Answers0