Inquiry about 'Access Denied' Error - Error Code: ER_ACCESS_DENIED_ERROR

I am writing to seek assistance with an issue I have encountered while using Aiven’s cloud MySQL database service.

I have been experiencing the following error when attempting to create databases dynamically for my multi-tenancy application:

our application usually successfully login into the default database provided by Aiven quite alright. The problem usually occurs if we tried to create more databases for users(we are using multi-tenant architecture - each user with his database)

  • Error Code: ‘ER_ACCESS_DENIED_ERROR’
  • Error Number: 1045
  • SQL State: ‘28000’
  • SQL Message: ‘Access denied for user ‘dedebubu’@‘105.113.10.92’ (using password: YES)’

This error occurs when the application attempts to create databases for each user, utilizing their registration details for login credentials, and setting up necessary tables within their specific databases. To provide you with more context, our environment uses Node.js version 16.17.1 and MySQL v8.x.

This issue started after migrating our application’s database from a localhost setup to Aiven’s cloud MySQL database service. I’m uncertain whether the issue is related to our code setup or if there are specific platform policies or configurations on your end that might be causing this ‘Access Denied’ error in the multi-tenancy database creation process.

Could you please investigate this issue and provide guidance on how we can resolve it? We would greatly appreciate any information or assistance you can offer to help us get our multi-tenancy system up and running smoothly on your platform.

Thank you for your prompt attention to this matter. If you require any further information or details about our setup, please let us know.

Best regards,

Danities Ichaba
luka316daniel@gmail.com
+2347035545177

1 Like

Best guess from the team, with no visibility in your setup, is that it seems that “the user in question does not have rights / grants to create a database”. And: to check your access levels for your instance.

Thank you for your reply.

Iam actually using the root user to grant all priliages to user in their specific database.
here is example of my mysql syntax::

CREATE DATABASE test_db;

CREATE USER 'test_user'@'xxxx-xxx-xxx.aivencloud.com' IDENTIFIED BY 'test_password';

GRANT ALL PRIVILEGES ON test_db.* TO 'test_user'@'xxxx-xxx-xxx.aivencloud.com';

FLUSH PRIVILEGES;

The irony is that i can use the root user credentials to login into the use-specific database but i cant use the credentials created for them to login into their databases.

1 Like