Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Fixing MySqlException (0x80004005) by Updating MySQL Connector or Client

3 min read
14.10.2025

Identify the Installed MySQL Client and Connector Versions

First, I check which version of MySQL server and client is installed.

Update MySQL Connector
Updating connector — match client version to server features.

For closely related MySQL 0x80004005 troubleshooting topics, see MySqlConnector Access Denied (admin guide), MySql.Data 0x80004005 — Causes and Fixes, and MySQL Error #1227 — SUPER Privilege.

For Linux (Ubuntu/Debian):

mysql --version

or

dpkg -l | grep mysql

For Linux (CentOS/RHEL):

rpm -qa | grep mysql

For Windows (Command Prompt):

mysql --version

For Windows (PowerShell):

Get-Command mysql | Select-Object Version

If the MySQL version is outdated, I update the MySQL server and client.

Update MySQL Connector for .NET (C#)

For C# applications using MySql.Data, I ensure the latest version is installed:

Install-Package MySql.Data -Version 8.0.33

or update it:

Update-Package MySql.Data

If using MySQL Connector/NET from MySQL Installer, I update it via:

  • MySQL Installer GUI (Windows) > Select MySQL Connector/NET > Click Upgrade.

Update MySQL Connector for Python

If the issue is in a Python application, I update MySQL Connector for Python:

pip install --upgrade mysql-connector-python

or

pip install --upgrade pymysql

Update MySQL Connector for Node.js

If a Node.js application is affected, I update the MySQL driver:

npm install mysql2@latest

If using the old mysql package, I recommend switching to mysql2, as it supports modern authentication methods.

Update MySQL Connector for PHP (MySQLi / PDO)

For PHP-based applications, I update MySQL-related packages:

Ubuntu/Debian:

sudo apt update && sudo apt install php-mysql

CentOS/RHEL:

sudo yum update php-mysqlnd

Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

Ensure MySQL Server Supports the Correct Authentication Method

Sometimes, after updating the client, authentication issues arise because MySQL 8+ defaults to caching_sha2_password, while older clients expect mysql_native_password.

I check which authentication plugin is being used:

SELECT user, host, plugin FROM mysql.user WHERE user = 'myuser';

If the plugin is caching_sha2_password but the client requires mysql_native_password, I switch it:

ALTER USER 'myuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypassword';
FLUSH PRIVILEGES;

Then, I restart MySQL:

sudo systemctl restart mysql

Restart the Application and Verify the Fix

Once the update is done, I:

  • Restart the application using MySQL to apply the changes.
  • Test the database connection manually using:
    mysql -u myuser -p -h localhost
  • Check application logs for any remaining issues.

Final Thoughts

As a server administrator, when I encounter MySqlException (0x80004005) due to an outdated MySQL client or connector, I:

  1. Check the installed MySQL client and connector versions.
  2. Update the MySQL connector for the affected language (C#, Python, PHP, Node.js, etc.).
  3. Ensure MySQL authentication is compatible with the connector.
  4. Restart the application and test the connection.

Following these steps ensures a smooth database connection without authentication errors!

Frequently asked questions
Default auth plugin in MySQL 8 is `caching_sha2_password`; old clients (PHP 5.6, MySql.Data 6.x, mysqlclient < 2.0) speak only mysql_native_password. Either upgrade client or downgrade users: `ALTER USER 'app'@'%' IDENTIFIED WITH mysql_native_password BY '';`. Both are valid; long-term, upgrade client is correct.
`mysql2` for any new code. `mysql` is the older single-maintainer package that hasn't kept up with newer auth plugins and TLS. `mysql2` is compatible API but Promise-native, supports prepared statements better, speaks caching_sha2_password. Migration is mostly drop-in.
Both use the same mysqlnd driver under the hood. The driver version (linked to PHP version) determines compatibility. PHP 7.4+ mysqlnd speaks caching_sha2_password; PHP 7.0 and older don't. Symptom is identical (auth fails); fix is PHP version upgrade, not changing between mysqli and PDO.
Connection string syntax changes (some options renamed or removed), pool defaults change (newer libraries pool more aggressively), error exception types change (old caught `Mysqli_sql_exception`; new catches different class). Test thoroughly in dev; review the connector's changelog from your old to new version for breaking changes.
Related articles
Updating MySQL Connector for PHP (MySQLi / PDO) to Fix Errors
MySql.Data.MySqlClient.MySqlException (0x80004005) — Causes and Fixes
Fixing MySqlConnector.MySqlException (0x80004005): Access Denied for User