0

I'm trying to setting up a mySql connection using Matlab, I have read I few tutorial but unfortunately I can't get work of them. I had tried to compile the source(.cpp) but I got the following error:

Error: Could not detect a compiler on local system 
which can compile the specified input file(s) 

  C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: No compiler options file could be found to compile source code. Please run "mex -setup" to rectify. 

So I I typed "mex -setup"

Please choose your compiler for building external interface (MEX) files: 

Would you like mex to locate installed compilers [y]/n? y

Select a compiler: 

[0] None 

Compiler:

but there is no compiler.

Anybody can help me, how can I make a connection between matlab and mysql, I'm using windows 7 64 bit and Matlab 2010b.

I already installed wampserver.

Mokus
  • 10,174
  • 18
  • 80
  • 122

2 Answers2

1

I'm guessing you installed Matlab 64-bit as well, which does NOT come with a built-in MEX compiler (32-bit version uses lcc). You have a few options, but the easiest is to install Visual C++ Express (it's free! http://www.microsoft.com/express/Windows/) which will give you a 64-bit compatible compiler in the mex -setup listing. You'll have to double check which versions of the compiler 2010b is compatible with though.

Caveat: I tried this once and couldn't get it to work, but it was with like 2007b or something, and I didn't try that hard, I just installed 32-bit Matlab.

Sean K.
  • 45
  • 6
1

Have you tried to establish MySQL connection from MATLAB using JBCC connector?

I did it successfully and put the complete workflow with the code example (requires Database Toolbox) in this question:

connection of MATLAB 7.0 and MYSQL

Haven't try on 64-bit though. Please let me know if it will fail.


UPDATE

You can also try the following submissions to File Exchange that do not require the Database toolbox:

Community
  • 1
  • 1
yuk
  • 19,098
  • 13
  • 68
  • 99
  • Whit these I get the following error:??? Undefined function or method 'database' for input arguments of type 'char'. Error in ==> connectTest at 12 conn = database(dbName, user , password, jdbcDriver, jdbcString); ??? Undefined function or method 'database' for input arguments of type 'char'. – Mokus Apr 20 '11 at 09:09
  • @iUngi: Sorry, it requires Database Toolbox available from the Mathworks. I'll update the answer. Probably there is another way using just java, I'll have a look. – yuk Apr 20 '11 at 13:58
  • Finally I found the answer at the morning but this solution is the same that you wrote in the Update. So if somebody is still looking for a connection between Matlab and MySQL here is the solution: Download the zip from the :http://sourceforge.net/projects/mym/ and compile using mex. If somebody has problem with compilation under windows 64bit I can help. – Mokus Apr 20 '11 at 14:28