Connect MySQL to MATLAB?

前端 未结 2 1437
一向
一向 2020-12-31 16:04

I would like to know how to connect a MySQL database to MATLAB software. I downloaded the jdbc connector but I\'m not getting how to specify the path.

2条回答
  •  情深已故
    2020-12-31 16:29

    http://desk.stinkpot.org:8080/tricks/index.php/2006/02/how-to-get-matlab-to-talk-to-mysql/

    Let me quote:

    1. open the classpath.txt file in [matlab path]/toolbox/local/ and add the following line to it (you can download jar file from http://dev.mysql.com/downloads/connector/j/, and after extract you can move it to under the folder : /usr/share/java)

      [path to unzipped jdbc driver package]/mysql-connector-java-3.1.12-bin.jar
      
    2. create a database in mysql (can look up here how to do that)

    3. to connect to the database you’ve created (call it “foo”), type into matlab:

      >> conn = database(‘foo’,’[your user name]‘,”,’com.mysql.jdbc.Driver’,'jdbc:mysql://localhost:3306/foo’)
      

提交回复
热议问题