MariaDB Auth_gssapi_client Plugin Pymysql Not Configured

Published
Length
3 min read

Luis Felipe Dias

All posts

You fix the mariadb auth_gssapi_client plugin pymysql not configured error by changing the user login method. You can also switch your Python app to a C-based database driver. Teams often see this error when linking Python scripts to enterprise databases. Admins set up Kerberos or Active Directory rules for database users. Then developers try to log in with a pure Python library. To bypass the error fast, teams often grant broad password-based admin roles. Those wide roles let scripts run any co

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You fix the mariadb auth_gssapi_client plugin pymysql not configured error by changing the user login method. You can also switch your Python app to a C-based database driver. Teams often see this error when linking Python scripts to enterprise databases. Admins set up Kerberos or Active Directory rules for database users. Then developers try to log in with a pure Python library. To bypass the error fast, teams often grant broad password-based admin roles. Those wide roles let scripts run any command across the whole database.

Why the mariadb auth_gssapi_client plugin pymysql not configured error happens

MariaDB uses special server plugins to check who is logging in. In many enterprise setups, admins pick the GSSAPI plugin for single sign-on. This method uses Kerberos tickets on Linux or Active Directory on Windows. When a client tries to log in, the server asks for a ticket. The server tells the client to use the matching client plugin. PyMySQL is a pure Python driver that speaks the MySQL protocol. It includes basic password login methods out of the box. Still, PyMySQL does not include the GSSAPI client login handler. When the server asks for GSSAPI, PyMySQL does not know what to do. It stops the login and throws the plugin not configured error.

How to align your Python driver and database login setup

You have two main ways to fix this login mismatch. Your first option is to change the database user account on the server. A database admin can switch that specific user to standard password login. Then PyMySQL can send a normal password and log in right away. This path works well for isolated service accounts in test setups. Your second option keeps Kerberos active for your database users. To do this, you replace PyMySQL with the official MariaDB Python connector. That official connector wraps the native C client library on your host. The C library includes the compiled GSSAPI client plugin file on disk. You also need a valid Kerberos ticket active in your local system cache. When the Python app runs, the native driver reads your ticket and logs in.

What native login plugins solve and what they leave open

Fixing the driver or user plugin solves the initial login check. Kerberos proves that the user or script is who it claims to be. Standard password plugins do the same basic job with a shared secret. Yet both methods stop working the moment the session starts. Database login plugins only decide who can open a session. They do not watch or control what SQL queries run during that session. Once your Python script logs in, it gets full permissions for that role. A bug in the script can still drop a table by mistake. An engineer using that role can still query sensitive customer tables. The database returns raw emails, phone numbers, card numbers, and national IDs. Native login plugins cannot rewrite matched fields in query results on the fly. They also cannot ask a manager to approve one risky update statement.

Network Location-Based Auth + Client-Initiated Backchannel Authentication (CIBA): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Add wire guardrails and masking beside MySQL

Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev runs beside the database as a sidecar for your MySQL. It keeps your login setup and drivers as they are while checking queries on the wire.

With hoop.dev MySQL support, guardrails refuse bad queries before they run and return a readable MySQL error. Data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.

Frequently asked questions

Why does PyMySQL fail when the CLI client works on the same host?

The MariaDB CLI uses the native C library, which includes the GSSAPI plugin. PyMySQL is written in pure Python and lacks support for Kerberos login handshakes.

Can I add the GSSAPI plugin directly into PyMySQL?

PyMySQL does not ship with a built-in GSSAPI handler for Kerberos tickets. Most teams switch to the official C-based MariaDB Python driver or change the user role.

Does Kerberos login protect sensitive rows inside MariaDB tables?

No, Kerberos only checks identity when the client first opens the database session. After login, the user can read any raw data allowed by their SQL grants.

The query runs. The emails stay hidden.