Invalid connection when connecting to MySQL.

조회 수: 11 (최근 30일)
Chen Zeyu
Chen Zeyu 2022년 5월 12일
답변: Shanmuganathan 2022년 11월 22일
I wrote my code as official guide of database toolbox as follows:
myconn=database('xxx','yy','zzz','com.mysql.jdbc.Driver','jdbc:mysql://121.41.144.24:11106/xxx')
sqlquery = "SELECT * FROM dw_IndexQuote";
data = select(myconn,sqlquery);
However, it report an error that Invalid connection.
the attribute of the connection is:
AutoCommit: ''
ReadOnly: ''
LoginTimeout: 0
MaxDatabaseConnections: -1
I don't know why. The information of connection is correct and I can use python to connect. I think there may be a mistake in configuration but I cannot figure it out.

답변 (1개)

Shanmuganathan
Shanmuganathan 2022년 11월 22일
Hi Chen,
I understand that you are facing an issue when trying to connect to MySQL database.
Please follow the below documentation to setup the data source and connect to MySQL database:
Regards,
Shanmuganathan

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by