[matlab][Solution] Running mysql commands in Matlab on linux (Centos) 64 bit

By.

min read

My profile

Share this:

Download the source at [url]http://www.cims.nyu.edu/~almgren/mysql/[/url]

Make sure you have these packages intalled:
mysql-devel-5.0.77-4.el5_6.6.x86_64 ( or simular )
mysqlckient14-devel-4.1.22-1.el5.centos.x86_64 ( or simular )

perhaps also this one:
mysql-connector-odbc-3.51.26r1127-1.el5.x86_64

verify that your have mysql.h and libmysqlclient.a
by checking their paths using

[code:1:fb8abeb4b2]sudo updatedb
locate mysql.h
locate libmysqlclient.a[/code:1:fb8abeb4b2]

Now visit matlab and mex the whole lot ( you need a gcc compiler to do this ! )
[code:1:fb8abeb4b2]mex -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient mysql.cpp[/code:1:fb8abeb4b2]

adapt your paths so in my case
[code:1:fb8abeb4b2]mex -I/usr/include/mysql -L/usr/lib64/mysql -lmysqlclient mysql.cpp[/code:1:fb8abeb4b2]

the paths can be found using the locate command (see above)

If all goes well .. you ‘ll end with a new file called mysql.mexa64 and you are ready to start your mysql business!

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *