Not successful connection to MySQL (native data source configuration)
Ältere Kommentare anzeigen
Hi folks
I am trying to querry data from a native source SQL using Database Explorer as below:

The parameters are set properly (this is verified using a Python API before)

When I test this connection, it takes forever and no response received. Looks like connection is not successful.

Any input is much appreciated.
Antworten (3)
Kojiro Saito
am 30 Aug. 2021
As written in this document, please make sure that you have installed MySQL Connector/C++ 8.0.15 driver.
---
MySQL Native Interface
You need to install the appropriate driver for your operating system. For the Windows® and macOS operating systems, use this link to download and install the driver. For Linux®, use this link.
---
Also, please make sure that you've added the path of driver libraries (by default in Windows, the path would be C:\Program Files\MySQL\Connector C++ 8.0\lib64).
setenv('PATH', [getenv('PATH') ';C:\Program Files\MySQL\Connector C++ 8.0\lib64']);
Or, add "C:\Program Files\MySQL\Connector C++ 8.0\lib64" to Windows System Path.
After that, I think you can avoid hang-up.
3 Kommentare
Kojiro Saito
am 31 Aug. 2021
Can your MATLAB see MySQL connector path?
Does the return of
getenv PATH
contain "C:\Program Files\MySQL\Connector C++ 8.0\lib64"?
Mohammad Alavirad
am 31 Aug. 2021
Kojiro Saito
am 31 Aug. 2021
OK, so the connector setting looks good to me.
How about deleting preference directory?
prefdir
will return MATLAB's preference directory.
(ex, C:\Users\USENAME\AppData\Roaming\MathWorks\MATLAB\R2021a)
Deleting this preference directory and relaunching MATLAB might solve this issue.
If not, you had better re-install MATLAB.
Mohammad Alavirad
am 30 Aug. 2021
Bearbeitet: Mohammad Alavirad
am 30 Aug. 2021
0 Stimmen
1 Kommentar
Punpiti Piamsa-nga
am 11 Jan. 2022
I get the same problem.
zhuofei wu
am 20 Sep. 2021
0 Stimmen
This vedio should be helpful. https://www.youtube.com/watch?v=XIgZlCdb-PA
1 Kommentar
Walter Roberson
am 20 Sep. 2021
(Video is about how to connect MATLAB to a database)
Kategorien
Mehr zu Database Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

