{"id":14982612,"url":"https://github.com/thecodemonkey86/qt_mysql_driver","last_synced_at":"2025-05-16T00:00:22.981Z","repository":{"id":38394333,"uuid":"208150766","full_name":"thecodemonkey86/qt_mysql_driver","owner":"thecodemonkey86","description":"Typical symptom: QMYSQL driver not loaded. Solution: get pre-built Qt SQL driver plug-in required to establish a connection to MySQL / MariaDB using Qt. Download qsqlmysql.dll binaries built from official Qt source code","archived":false,"fork":false,"pushed_at":"2025-04-03T20:26:33.000Z","size":222,"stargazers_count":456,"open_issues_count":14,"forks_count":60,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-08T11:07:58.890Z","etag":null,"topics":["cpp","dll","mysql","mysql-library","qsqldatabase","qt5","qt6","sql-driver"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodemonkey86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.LGPLv21","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.paypal.com/donate/?hosted_button_id=2K7H59EFMSRDU"]}},"created_at":"2019-09-12T21:38:08.000Z","updated_at":"2025-04-05T03:16:19.000Z","dependencies_parsed_at":"2023-02-06T09:45:17.655Z","dependency_job_id":"79c40956-7af0-4563-bd68-b5e130f72fab","html_url":"https://github.com/thecodemonkey86/qt_mysql_driver","commit_stats":{"total_commits":74,"total_committers":2,"mean_commits":37.0,"dds":0.08108108108108103,"last_synced_commit":"7a972e859972cce32ac09c90fa3fff6a32451d1f"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodemonkey86%2Fqt_mysql_driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodemonkey86%2Fqt_mysql_driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodemonkey86%2Fqt_mysql_driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodemonkey86%2Fqt_mysql_driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodemonkey86","download_url":"https://codeload.github.com/thecodemonkey86/qt_mysql_driver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","dll","mysql","mysql-library","qsqldatabase","qt5","qt6","sql-driver"],"created_at":"2024-09-24T14:05:44.487Z","updated_at":"2025-05-16T00:00:22.311Z","avatar_url":"https://github.com/thecodemonkey86.png","language":null,"readme":"Typical symptom when trying to connect to MySQL / MariaDB using Qt but without the necessary plugin is the runtime error \n\n\n\u003cpre\u003e\u003ccode\u003e\n QSqlDatabase: QMYSQL driver not loaded\n QSqlDatabase: available drivers: QMYSQL\n\u003c/code\u003e\u003c/pre\u003e\n\n\nSince the Qt Company cannot provide qsqlmysql.dll / libqsqlmysql.so in binary form, you have to build it on your own, which can be a pain. Here is a build for various Qt versions. Get precompiled qsqlmysql.dll for Windows / libqsqlmysql.so for Linux from \u003ca href=\"https://github.com/thecodemonkey86/qt_mysql_driver/releases\"\u003ereleases\u003c/a\u003e. \u003cstrong\u003eBe sure to match your Qt version and compiler (Microsoft Visual C++/MSVC, MinGW) \u003ci\u003eEXACTLY\u003c/i\u003e. For example if you use Qt 6.4.2, you cannot use driver version 6.4.1 or 6.4.3\u003c/strong\u003e\n\nThis is helpful to you? If you wish, you have the possibility to support me by donating \u003ca href=\"https://www.paypal.com/donate/?hosted_button_id=2K7H59EFMSRDU\"\u003ehere\u003c/a\u003e. Thank you so much everyone who has donated so far\n\n\u003ca href=\"https://www.paypal.com/donate/?hosted_button_id=2K7H59EFMSRDU\"\u003e\u003cimg src=\"https://github.com/thecodemonkey86/qt_mysql_driver/assets/11927938/02524397-e7f7-47ca-be6b-7c8d3a3b5b32\"\u003e\u003c/a\u003e\n\n\u003cb\u003e\nLatest Qt6 version: Download for Qt 6.8.3 \u003ca href=\"https://github.com/thecodemonkey86/qt_mysql_driver/releases/tag/qmysql_6.8.3\"\u003ehere\u003c/a\u003e\u003cbr\u003e\nFor Android see 3rd party repository https://github.com/sayyyed/qt_android_mysql_driver/releases/tag/qt_mysql_driver_for_android\n\u003c/b\u003e\n\u003cbr\u003e\n\n\n\u003ch4\u003eDeployment\u003c/h4\u003e\n\n1) copy qsqlmysql.dll (release build) / MSVC: qsqlmysqld.dll, MinGW: qsqlmysql.dll+qsqlmysql.debug (debug build) to subdirectory \"sqldrivers\" of application directory (or build directory while developing) \n \u003cimg src=\"https://github.com/thecodemonkey86/qt_mysql_driver/assets/11927938/ad400ff5-04b2-40f0-b9ab-b72f89168ebd\"/\u003e\n\n2) copy libmysql.dll (MySQL library) and the libcrypto/libssl OpenSSL libraries from zip file (or from https://dev.mysql.com and https://kb.firedaemon.com/support/solutions/articles/4000121705  respectively) to application directory (or more generally, any directory that is registered in PATH environment variable)\n\n \u003cimg src=\"https://github.com/thecodemonkey86/qt_mysql_driver/assets/11927938/8a894abf-bd6a-4016-853d-4e210e2c23bb\"/\u003e\n\n\n\u003chr\u003e\n\u003ch4\u003eBuilding from source (Qt6/CMake)\u003c/h4\u003e\n\n\u003ch5\u003eWindows\u003c/h5\u003e\nfor MSVC:\n\nPrerequisites:\n1. Install MSVC Compiler (C++ Desktop Toolkit from [Visual Studio 2022 Setup](https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=community\u0026channel=Release\u0026version=VS2022\u0026source=VSLandingPage\u0026includeRecommended=true\u0026cid=2030))\n2. Install Qt incl. Sources, CMake and Ninja from Maintenance Tool\n3. Install MySQL library, e.g. by using [Oracle's Installer](https://dev.mysql.com/downloads/installer/) or use the zip file from [here](https://github.com/thecodemonkey86/qt_mysql_driver/releases/tag/libmysql)\n\n```console\nset PATH=%PATH%;C:\\Qt\\Tools\\CMake_64\\bin;C:\\Qt\\Tools\\Ninja\nC:\ncd C:\\Qt\\6.8.1\\Src\\qtbase\\src\\plugins\\sqldrivers\ncall \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"\ncall C:\\Qt\\6.8.1\\msvc2022_64\\bin\\qt-cmake.bat -G \"Ninja Multi-Config\" . -DMySQL_INCLUDE_DIR=\"E:\\qt_creator\\libs\\libmysql\\include\" -DMySQL_LIBRARY=\"E:\\qt_creator\\libs\\libmysql\\lib\\libmysql.lib\" -DCMAKE_INSTALL_PREFIX=\"C:\\Qt\\6.8.1\\msvc2022_64\" -DCMAKE_CONFIGURATION_TYPES=Release;Debug  -DQT_GENERATE_SBOM=OFF\nninja\nninja install\npause\n```\n\nfor MinGW:\n\nPrerequisites:\n1. Install Qt incl. Sources, CMake and MinGW from Maintenance Tool\n2. Install MySQL library, e.g. by using [Oracle's Installer](https://dev.mysql.com/downloads/installer/) or use the zip file from [here](https://github.com/thecodemonkey86/qt_mysql_driver/releases/tag/libmysql)\n\n```console\nset PATH=%PATH%;C:\\Qt\\Tools\\mingw1310_64\\bin\nC:\ncd C:\\Qt\\6.8.1\\Src\\qtbase\\src\\plugins\\sqldrivers\ncall C:\\Qt\\6.8.1\\mingw_64\\bin\\qt-cmake.bat -G \"Ninja Multi-Config\" . -DMySQL_INCLUDE_DIR=\"E:\\qt_creator\\libs\\qmysql_driver\\mysql-connector-c-6.1.11-winx64\\include\" -DMySQL_LIBRARY=\"E:\\qt_creator\\libs\\qmysql_driver\\mysql-connector-c-6.1.11-winx64\\lib\\libmysql.lib\" -DCMAKE_INSTALL_PREFIX=\"C:\\Qt\\6.8.1\\mingw_64\" -DCMAKE_C_COMPILER=\"gcc.exe\" -DCMAKE_CXX_COMPILER=\"g++.exe\" -DCMAKE_CONFIGURATION_TYPES=Release;Debug   -DQT_GENERATE_SBOM=OFF\nninja\nninja install\npause\n```\n","funding_links":["https://www.paypal.com/donate/?hosted_button_id=2K7H59EFMSRDU"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodemonkey86%2Fqt_mysql_driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodemonkey86%2Fqt_mysql_driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodemonkey86%2Fqt_mysql_driver/lists"}