Filter löschen
Filter löschen

Why does matlab crash when I try to query from my database(MySql)?

3 Ansichten (letzte 30 Tage)
After updating MySQL (ver.: 8.0.12) MATLAB crashes every time I try to query from the database (MATLAB has encountered an internal problem and needs to close.). I can successfully connection to the DB, but it crashes when I ty to query. I only encounter the problem when trying to query from the DB, otherwise MATLAB seems to run as normal. I encounter the same problem in 2017b and 2018a.
  2 Kommentare
Geoff Hayes
Geoff Hayes am 15 Aug. 2018
Öyvind - what is your query? What do you expect it to return? (i.e. how many records are querying for?)
Öyvind Karlsson
Öyvind Karlsson am 15 Aug. 2018
I have used the following query, which should return approximately 360 rows/8 columns:
SELECT days.user_id, days.year, days.period, attributes as sickday
FROM days
LEFT JOIN day_results ON days.id = day_results.day_id
LEFT JOIN workout_parts ON day_results.workout_id = workout_parts.workout_id
LEFT JOIN parts ON workout_parts.part_id = parts.id
WHERE (days.user_id = 245 or days.user_id = 64 or days.user_id = 81 or days.user_id = 512 or days.user_id = 244 or days.user_id = 154 or days.user_id = 153 or days.user_id = 449 or days.user_id = 432 or days.user_id = 255 or days.user_id = 210 or days.user_id = 212 or days.user_id = 697 or days.user_id = 730 or days.user_id = 1064 or days.user_id = 553 or days.user_id = 169 or days.user_id = 476 or days.user_id = 172 or days.user_id = 881 or days.user_id = 70 or days.user_id = 167)
AND (days.year < 2018 and days.year >= 2012)
GROUP BY days.id
ORDER BY days.year, days.period, days.week, days.day;
However, I have also tried much simpler queries and I encounter the same problem;

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Kojiro Saito
Kojiro Saito am 20 Aug. 2018
I think this is the same issue as described in this answer. It might be related to MySQL ODBC 8.x drivers.
There are two workaround.
1. Use other MySQL ODBC Connector versions than 8.x (for example, MySQL ODBC 5.3 )
2. Use JDBC drivers instead of ODBC.
I'm using MySQL JDBC driver 8.0.11 with MATLAB R2018a, it works.

Weitere Antworten (0)

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by