September 12, 2003

Matlab + MySQL

Wow, so cool, I love the the web. I've been storing a lot of my data - about 50,000,000 rows, in MySQL and doing queries and manipulations via PHP from another PC. I was planning on writing a PHP script to format my data into Matlab readable files when I discovered, to my great joy, that a Matlab mysql tool has already been written. Rock and roll! I think the original one came from here. But maybe they are separate efforts...

I installed the Windows version without a hitch though the Unix version I have to mess around with still. At Stanford the school computers run Solaris.

Acutally, there was a hitch. I was getting segmentation fault on my queries. The problem turned out to be the version of Matlab I was using (6.1). I downloaded the Toronto mysql.cpp mex file and compiled it by their instructions and now it works just fine. Robert Almgren, you rock.

Posted by torque at September 12, 2003 11:58 PM | TrackBack

Hi Robert

I am trying to store abd retrieve data from Ms-Access via MATLB. The data is numerical. It works fine but there is slow response in data retrieval. I am thinking to move my tables in Ms-Access to Mysql and then retrieve the data from mysql via sql statements written in MATLAB.

How is that is possible please?
Kind regards,

Posted by: HElshtwi at November 14, 2003 2:43 AM

torque, would you mind sending the dll's you used as I am having trouble using MatLab 6.1 to. I get the following error message.

Unable to load mex file: D:\Programme\MATLAB6p1\toolbox\local\mysql.dll.
Das angegebene Modul wurde nicht gefunden.

though it is definitely there.

??? Invalid MEX-file

thank you.

Posted by: Paul at November 28, 2003 4:37 AM

Unable to load mex file: C:\MATLAB6p1\work\mysql.dll.
One of the library files needed to run this application cannot be found.

I am getting this error message when I try to use MySql database with Matlab. I have version 6.1 of Matlab and the dll file is in the correct location. Any ideas?



Posted by: John at December 7, 2003 7:57 AM

//Hi frenz...

I also tried a lot to connect the MySQL to MATLAB 6.1 but alwayz got the same error..

Seems to be a problem with the .dll files or the relative compatibility of the MATLAB version..

If anyone got the answer to this querry.. plz do reply..


Posted by: Ranz at February 18, 2005 3:27 PM

Remember that Matlab must be able to locate libmysql.dll for this to work. The error messages above are typical examples of this problem.

I have copied libmysql.dll (from mysql distribution) to the same location where mysql.dll is, and it works just fine.

Posted by: Åsmund Hjulstad at April 5, 2005 6:21 AM

hello friends

i would like to connect a mysql database to matlab but i have no clue how to do that.

i have mysql version 4.1.8 and matlab 7 (R14). i tryed with an odbc connection but it didn't work.
(conn = database('db_name', 'root', 'password')

i saw that i have to establish the connection via a jdbc code, but i don't know the driver name nor the url. how can i find it? or can someone help me with this issue?


Posted by: georg pristas at April 12, 2005 2:46 AM
Post a comment

Remember personal info?