Skip to content

Commit a814919

Browse files
committed
fix: use mysql_native_password to avoid missing caching_sha2_password plugin
1 parent fdc5c99 commit a814919

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

TablePro/Core/Database/MariaDBConnection.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ final class MariaDBConnection: @unchecked Sendable {
220220
// Set character set to UTF-8
221221
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, "utf8mb4")
222222

223+
// Use mysql_native_password auth plugin
224+
// MariaDB Connector/C tries to load caching_sha2_password as an external .so plugin
225+
// which doesn't exist in the distributed app bundle. mysql_native_password is built-in
226+
// and supported by MySQL 5.7+, 8.x, and MariaDB.
227+
mysql_options(mysql, MYSQL_DEFAULT_AUTH, "mysql_native_password")
228+
223229
// Connect to server
224230
// mysql_real_connect returns the handle on success, NULL on failure
225231
// IMPORTANT: All withCString closures must be nested so pointers remain valid

0 commit comments

Comments
 (0)