当前位置:网站首页>MATLAB and MySQL database connection and data exchange (based on ODBC)
MATLAB and MySQL database connection and data exchange (based on ODBC)
2022-06-26 21:37:00 【Baozheng dream sound】
One 、 To configure ODBC data source
1.1、 install Mysql-connect-ODBC drive , Click on mysql-connector-odbc-5.2.5-winx64.msi

1.2、 Click next NexT

1.3、 choice :I accept the terms in the license agreement

1.4、 choice Typical, next step Next


1.5、ODBC The driver is installed
Two 、 Click... In the control panel “ Management tools ”

2.1、 choice 64 position ODBC data source
Set up ODBC Data source , You can specify the user data source name (DSN) Or the system DSN. user DSN Is specific to the person who logs on to the computer . Only this person can see in the user DSN Data sources defined on the tab . System DSN It is not specific to the person who logs on to the computer . Anyone who logs on to the machine can see that SystemDSN Data sources defined on the tab . You set the user DSN Or the system DSN The capability of depends on the database and ODBC The driver . For more information , Please contact the database administrator or refer to ODBC Driver documentation .

2.2、 Click Add

2.3、 choice “MySQL ODBC 8.0 Unicode Driver”

2.4、 Fill in the database information ,Data Source Name Is the database name ;Description Is to describe , Not required ;
TCP/IP Server You can fill in localhost or 127.0.0.1;User Username , The default is root;Password Is password , For installation MySQL The password you filled in when ; And then click Test, Tips connect successful, The successful . And then click OK.
- stay Data source name In the box , Enter the appropriate name for the data source , Such as MySQL. Use this name to establish a connection to the database .
- stay describe In the box , Enter a description for this data source , Such as MySQL database.
- stay TCP/IP The server In the box , Enter the name of the database server . About the name of the database server , Please consult the database administrator .
- stay harbor Box . The default port number is 3306.
- stay user In the box , Enter your user name .
- stay password Box to enter your password .
- stay database In the box , Enter the name of the database .

2.5、 Configuration complete .

3、 ... and 、 stay matlab Operation in
3.1、 open MATLAB, stay APP Choose from Database Explorer;
By clicking MATLAB On the toolbar Apps Tab opens the Database Explorer Application . then , stay “ Applications ” The right side of the section , single click “ Show more ” arrow , Open the application library . stay “ Database connectivity and reporting ” Next , single click “ Database Explorer ”. perhaps , Enter at the command line DatabaseExplorer. stay “ data source ” In the part , choice “ Configure data sources > To configure ODBC data source ”.

3.2、 Select the built database in the pop-up window , Enter the user name and password , Click on connect;

3.3、 The following figure shows the successful connection

3.4、 Enter the code on the command line , Get data , Here's the picture ;
Connect to MySQL Use ODBC Drivers and command lines
Use ODBC The data source name connects to the database . for example , This code assumes that you are connecting to a named MySQL Have user name username And password pwd.
conn = database('MySQL','username','pwd');Closed database connection .
close(conn)

边栏推荐
- Netease Yunxin officially joined the smart hospital branch of China Medical Equipment Association to accelerate the construction of smart hospitals across the country
- Leetcode question brushing: String 02 (reverse string II)
- Test comparison of linear model LN, single neural network SNN, deep neural network DNN and CNN
- [Bayesian classification 3] semi naive Bayesian classifier
- Can compass open an account for stock trading? Is it safe?
- 关于appium踩坑 :Encountered internal error running command: Error: Cannot verify the signature of (已解决)
- How SAP Spartacus default routing configuration works
- 茂莱光学科创板上市:拟募资4亿 范一与范浩兄弟为实控人
- [solution] sword finger offer 15 Number of 1 in binary (C language)
- SAP Commerce Cloud 项目 Spartacus 入门
猜你喜欢

Redis + guava local cache API combination, performance burst!

关于appium踩坑 :Encountered internal error running command: Error: Cannot verify the signature of (已解决)

Leetcode question brushing: String 06 (implement strstr())

Student information management system based on SSH Framework

【protobuf 】protobuf 昇級後帶來的一些坑

VB.net类库——4给屏幕截图,裁剪

GameFi 活跃用户、交易量、融资额、新项目持续性下滑,Axie、StepN 能摆脱死亡螺旋吗?链游路在何方?

Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)

Record a redis large key troubleshooting

第2章 构建自定义语料库
随机推荐
Can compass open an account for stock trading? Is it safe?
经典Wide & Deep模型介绍及tensorflow 2代码实现
How to install mysql8.0 database under Windows system? (Graphic tutorial)
The importance of using fonts correctly in DataWindow
Convolutional neural network (CNN) explanation and tensorflow2 code implementation
Establish a connection with MySQL
Leetcode question brushing: String 05 (Sword finger offer 58 - ii. left rotation string)
协同过滤进化版本NeuralCF及tensorflow2实现
Shiniman household sprint A shares: annual revenue of nearly 1.2 billion red star Macalline and incredibly home are shareholders
Talk about my remote work experience | community essay solicitation
【贝叶斯分类3】半朴素贝叶斯分类器
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection
与 MySQL 建立连接
windows系統下怎麼安裝mysql8.0數據庫?(圖文教程)
VB.net类库,获取屏幕内鼠标下的颜色(进阶——3)
Many gravel 3D material mapping materials can be obtained with one click
传纸条【动态规划】
Leetcode: hash table 08 (sum of four numbers)
基于启发式搜索的一字棋
SAP Commerce Cloud 项目 Spartacus 入门