Why does Matlab 2023 and 2024 crash when using Database Explorer to view connections that have the mysql odbc 9.x? It works with 8.x versions.

12 visualizaciones (últimos 30 días)
I am unable to view databases within Matlab 2023b or 2024a that are using any mysql odbc connectors versions 9.x and greater. It works when the odbc's are set up using mysql odbc connect 8.x versions. I have the latest (14.x) Visual C++ Redistributable installed on the machine.

Respuestas (1)

Jack
Jack el 8 de Mayo de 2025
MATLAB’s Database Explorer relies on a 64-bit, ANSI-compliant ODBC driver under the hood, and the MySQL ODBC 9.x series installs a Unicode-only driver by default that isn’t fully compatible with MATLAB’s built-in ODBC interface. When you point Database Explorer at a 9.x DSN, MATLAB actually invokes that incompatible driver and ends up crashing. The 8.x drivers still include the legacy ANSI driver, so Database Explorer works fine with them.
What you can do:
  1. Continue using MySQL ODBC 8.x for any MATLAB Database Explorer work—that driver bundle still installs the ANSI driver that MATLAB supports.
  2. Switch to JDBC:
  • Download the MySQL Connector/J (mysql-connector-java-8.x.x.jar) from dev.mysql.com.
  • In MATLAB, go to Home → Add-Ons → Manage Java Class Path, and add the .jar.
  • Then in Database Explorer choose JDBC rather than ODBC and enter a URL likejdbc:mysql://hostname:3306/yourDatabase
  • Supply your username/password and click Connect.This bypasses ODBC entirely and is fully supported in MATLAB 2023b/2024a.
  1. (Advanced) Mix ANSI with Unicode driver:If you really need ODBC, re-create your 9.x DSN but explicitly select the “ANSI Driver” instead of the Unicode driver in the ODBC Administrator. That isn’t recommended long-term, but can unblock you in a pinch.
— Follow me so you can message me anytime with future questions. If this helps, please accept the answer and upvote it as well.

Productos


Versión

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by