[MDEV-28033] Sporadically Host is not allowed to connect to this MariaDB server when Create User if not exists Created: 2022-03-10  Updated: 2022-03-10

Status: Open
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 10.5.15, 10.8.2
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Joerg Plenert Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Docker:latest on Ubuntu:20.04
Two containers - one for MariaDB, one for the Application
Application running on MySQLConnector (for dotnet) 2.15

Parameters for mariaDB
command:

  • "--max_allowed_packet=67108864"
  • "--default-time-zone=+00:00"


 Description   

Sporadically MariaDB returns Host '<IP>' is not allowed to connect to this MariaDB server
This happens if the user is already existing but a CREATE USER IF NOT EXISTS / FLUSH PRIVILEGES; is called on the logon user.

About 95% of the connections do work, 5% results in the error above.

mysql.user:

  • mariadb.sys@localhost
  • root@localhost
  • app@%

Application is connecting using user app

Log in MariaDB:
2022-03-10 9:05:36 8 [Warning] Aborted connection 8 to db: 'unconnected' user: 'unauthenticated' host: '192.168.48.3' (This connection closed normally without authentication)

MySQL 8 does not show this behavior and but is logging a warning on the console.

Idea
It seems that MariaDB is somehow recreating the user even if it exists. That may guide to the fact that - meanwhile - another connection is not possible for this user.


Generated at Thu Feb 08 09:57:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.