View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.0 | 1 rating Rate this file 9 Downloads (last 30 days) File Size: 1.43 KB File ID: #24703 Version: 1.0



Jozef (view profile)


very simple mysql class file for working with mysql databases.

| Watch this File

File Information

In m file just change line
obj.dbconn = database('name', 'user', 'password');
using your own data.

In main program just do connection = mysql.

Result = connection.execute('statement') executes any mysql statement and obtains data, if any, in variable result.

connection.tableExists('tableName') is true/false based on existence of the tableName in Mysql database.


This file inspired Database Project Of Attendence System.

Required Products Database Toolbox
MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
06 Jan 2011 Jozef

Jozef (view profile)

You need to check, whether your mySQL server is up and running well
first outside MATLAB.
second you need to do this:

inside my file change 'name', 'user' and 'password'.

and then just conn = database; and then conn.execute('sql statement');


Comment only
05 Jan 2011 J. Hu

J. Hu (view profile)

I change obj.dbconn = database('name', 'user', 'password') using my own data; and then do

connection = mysql

but I got following message:

??? Error using ==> mysql>mysql.mysql at 15
Not possible to connect to MYSQL

Can you tell me what is wrong? Sorry I am new to connection to mySQL using matlab.

Contact us