WIN7 64-bit system Matlab Access Mysql database (detailed!) )

Source: Internet
Author: User
Tags mysql query

Win7 64-bit system Matlab Access Mysql database

PS: Read a lot of the internet with the use of MATLAB to connect MySQL technology paste, but the actual operation of the problem always appear, now write down the detailed technical paste, hope that less detours later! The following will also write some MATLAB database statements!

Instance:

I) Download to get mysql-connector-java-5.1. -bin.jar;

http://dev.mysql.com/downloads/connector/j/

Download:mysql-connector-java-gpl-5.1.35.msi (Don't worry about this is a three-digit)

Run --c:\programfiles (x86) \mysql\mysql Connector J--mysql-connector-java-5.1.35-bin.jar

II) Copy to the D:\ProgramFiles\Matlab\R2009b\java\jar\toolbox folder;

III) Classpath.txt documentation for Path D:\Program files\matlab\r2009b\toolbox\local adds a word to the JDBC driver used to load MySQL

$matlabroot/java/jar/toolbox/mysql-connector-java-5.1. -bin.jar, turn off matlab, turn it back on, all OK.

Note: 1. Add $matlabroot/java/jar/toolbox/mysql-connector-java-5.1 directly to the Classpath.txt. you can-bin.jar. Do not add the preceding #

2. mysql-connector-java-5.1. -bin.jar version to be consistent

3. conn =database (' Test ', ' root ', ' 123456 ', ' com.mysql.jdbc.Driver ', ' Jdbc:mysql ://127.0.0.1:3306/test ')

conn =

       Instance: ' imgtograph '
        UserName: ' Root '
         driver: [] '
            url: []
    Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
        message: ' Unable to find JDBC driver. '
         handle:0
        timeout:0
     autocommit: ' Off '
           type: ' Database Object '

Error:' Unable to find JDBC driver. '
Resolution: 1. Test must be the database name, not the connection name (when mysql-connector-java-5.1 is found. -bin.jar Copy and classpath.txt are correct, check your statement if there is a problem! )

2. To restart Matlab

Conn=database (' 123 ', ' root ', ' 123456 ', ' com.mysql.jdbc.Driver ', ' jdbc:mysql://127.0.0.1:3306/123 ')

conn =

Instance: ' 123 '

UserName: ' Root '

Driver: ' Com.mysql.jdbc.Driver '

URL: ' jdbc:mysql://127.0.0.1:3306/123 '

Constructor: [1x1com.mathworks.toolbox.database.databaseconnect]

Message: []

Handle: [1x1com.mysql.jdbc.jdbc4connection]

timeout:0

Autocommit: ' On '

Type: ' Database Object '

Success!

Reference: 1. http://blog.sina.com.cn/s/blog_5071eb880100w1i3.html matlab connection MySQL installation detailed paste!

2. http://www.blogjava.net/qileilove/archive/2014/05/08/413436.html matlab to write MySQL query statement paste!

WIN7 64-bit system Matlab Access Mysql database (detailed!) )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.