Code covered by the BSD License  

Highlights from
mysql

4.0

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

mysql

by Jozef

 

11 Jul 2009

very simple mysql class file for working with mysql databases.

| Watch this File

File Information
Description

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.

Required Products Database Toolbox
MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
05 Jan 2011 Bruce Heu

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.

06 Jan 2011 Jozef

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');

Jozef

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
mysql Jozef 13 Jul 2009 12:14:23
database Jozef 13 Jul 2009 12:14:23
database James 08 Oct 2010 19:30:39
database Jaroslaw Tuszynski 03 Dec 2010 16:46:08

Contact us at files@mathworks.com