{"id":"cc4fc9f29ad685c0","repo":"go-sql-driver/mysql","slug":"this-authentication-plugin-is-not-supported","errorCode":null,"errorMessage":"this authentication plugin is not supported","messagePattern":"this authentication plugin is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"errors.go","lineNumber":26,"sourceCode":"\npackage mysql\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\n// Various errors the driver might return. Can change between driver versions.\nvar (\n\tErrInvalidConn       = errors.New(\"invalid connection\")\n\tErrMalformPkt        = errors.New(\"malformed packet\")\n\tErrNoTLS             = errors.New(\"TLS requested but server does not support TLS\")\n\tErrCleartextPassword = errors.New(\"this user requires clear text authentication. If you still want to use it, please add 'allowCleartextPasswords=1' to your DSN\")\n\tErrNativePassword    = errors.New(\"this user requires mysql native password authentication\")\n\tErrOldPassword       = errors.New(\"this user requires old password authentication. If you still want to use it, please add 'allowOldPasswords=1' to your DSN. See also https://github.com/go-sql-driver/mysql/wiki/old_passwords\")\n\tErrUnknownPlugin     = errors.New(\"this authentication plugin is not supported\")\n\tErrOldProtocol       = errors.New(\"MySQL server does not support required protocol 41+\")\n\tErrPktSync           = errors.New(\"commands out of sync. You can't run this command now\")\n\tErrPktSyncMul        = errors.New(\"commands out of sync. Did you run multiple statements at once?\")\n\tErrPktTooLarge       = errors.New(\"packet for query is too large. Try adjusting the `Config.MaxAllowedPacket`\")\n\tErrBusyBuffer        = errors.New(\"busy buffer\")\n\n\t// errBadConnNoWrite is used for connection errors where nothing was sent to the database yet.\n\t// If this happens first in a function starting a database interaction, it should be replaced by driver.ErrBadConn\n\t// to trigger a resend. Use mc.markBadConn(err) to do this.\n\t// See https://github.com/go-sql-driver/mysql/pull/302\n\terrBadConnNoWrite = errors.New(\"bad connection\")\n)\n\nvar defaultLogger = Logger(log.New(os.Stderr, \"[mysql] \", log.Ldate|log.Ltime))\n\n// Logger is used to log critical error messages.\ntype Logger interface {\n\tPrint(v ...any)","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/go-sql-driver/mysql/blob/c426bd93799de0f0e094c8f0582872c529d0ed0a/errors.go#L8-L44","documentation":"ErrUnknownPlugin is returned at auth.go:342 (the default case of the auth plugin switch) when the server requests an authentication plugin that the driver does not implement. The driver logs `\"unknown auth plugin: <name>\"` and returns this sentinel. Known plugins are caching_sha2_password, mysql_old_password, mysql_clear_password, mysql_native_password, sha256_password, and client_ed25519.","triggerScenarios":"The MySQL/MariaDB server advertises an auth plugin outside the implemented set — e.g. a newer MariaDB plugin (gssapi, named_pipe, dialog), an enterprise plugin, or a future plugin introduced after this driver version. The default branch at auth.go:340 fires.","commonSituations":"Driver version is older than the server (plugin mismatch); connecting to MariaDB with a plugin the MySQL driver lacks; corporate enterprise auth setups.","solutions":["Upgrade go-sql-driver/mysql to a version that supports the plugin.","Change the user account to a supported plugin: `ALTER USER ... IDENTIFIED WITH caching_sha2_password` (MySQL) or mysql_native_password.","If the plugin is non-negotiable, find a fork or contribute support; check the logged plugin name via mc.log output."],"exampleFix":"// before\n$ go get github.com/go-sql-driver/mysql@v1.6.0  // older, lacks some plugins\n// after\n$ go get github.com/go-sql-driver/mysql@latest","handlingStrategy":"try-catch","validationCode":"// After connecting, query the server-advertised plugin:\n// SELECT plugin FROM mysql.user WHERE user=? AND host=?\n// ensure it is in the supported set before relying on it.","typeGuard":"var supportedPlugins = map[string]bool{\"caching_sha2_password\":true,\"mysql_native_password\":true,\"sha256_password\":true,\"mysql_clear_password\":true,\"mysql_old_password\":true,\"client_ed25519\":true}","tryCatchPattern":"if errors.Is(err, mysql.ErrUnknownPlugin) {\n    log.Printf(\"server requested an unsupported auth plugin; upgrade driver or ALTER USER\")\n}","preventionTips":["Keep the driver version current with the server.","Standardize accounts on caching_sha2_password.","Log the plugin name when the error occurs."],"tags":["auth","version","compatibility"],"analyzedSha":"c426bd93799de0f0e094c8f0582872c529d0ed0a","analyzedAt":"2026-08-04T21:52:59.219Z","schemaVersion":2}