This video describes how to connect MATLAB with database (MySQL). First you need to install ODBC connector, the link to download ODBC connector is https://dev.mysql.com/downloads/connector/odbc/5.3.html.
Please copy and past below code to check whether your database is connected or not.
conn = database('database_name','username','pwd');
curs = exec(conn,'SELECT * FROM Table_name');
curs = fetch(curs);
curs.Data