MySQL + MATLAB -> Invalid connection

6 views (last 30 days)
Steven on 12 Oct 2011
I'm trying to set up MySQL with MATLAB with no success. I downloaded EasyPHP and I created a simple database named 'mydata'. I also enabled the php_pdo_odbc in PHP extensions. For the rest, I let the default settings. Finally, I put my file into the \www folder with the following content:
clear all;
conn = database('mydata','root','');
and this error resulted :
??? Error using ==> at 153
Invalid connection.
Error in ==> myfile at 4
I use MatlabR2010a on Windows 7, 64 bit and database toolbox version 3.7. I've tried different username such as 'root', 'localhost', '' but no way to fix it. Your help is welcome.
Regards, Steven
  1 Comment
Kaustubha Govind
Kaustubha Govind on 12 Oct 2011
Check conn.Message and see if you are getting any useful error message.

Sign in to comment.

Accepted Answer

Steven on 12 Oct 2011
Hi folks,
I finally fixed the prob !
First, I downloaded MySQL ODBC driver 5.1. Then, I add it in Start > Settings > Control Panel > Administrative Tools > Data Sources(ODBC)
and everything works well !

More Answers (0)


Community Treasure Hunt

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

Start Hunting!