当前位置:网站首页>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)

边栏推荐
- 诗尼曼家居冲刺A股:年营收近12亿 红星美凯龙与居然之家是股东
- leetcode刷题:字符串03(剑指 Offer 05. 替换空格)
- 股票炒股注册开户有没有什么风险?安全吗?
- Treasure and niche cover PBR multi-channel mapping material website sharing
- 证券注册开户有没有什么风险?安全吗?
- About appium trample pit: encountered internal error running command: error: cannot verify the signature of (solved)
- y48.第三章 Kubernetes从入门到精通 -- Pod的状态和探针(二一)
- Is there any risk in opening a mobile stock registration account? Is it safe?
- SAP Spartacus 中的依赖注入 Dependency Injection 介绍
- 中金证券经理给的开户二维码办理股票开户安全吗?我想开个户
猜你喜欢

【连载】说透运维监控系统01-监控系统概述

【贝叶斯分类2】朴素贝叶斯分类器

Leetcode: String 04 (reverse the words in the string)

Leetcode question brushing: String 03 (Sword finger offer 05. replace space)

ICML2022 | Neurotoxin:联邦学习的持久后门

The source code that everyone can understand (I) the overall architecture of ahooks

Two methods of QT to realize timer

第2章 构建自定义语料库

Leetcode question brushing: String 05 (Sword finger offer 58 - ii. left rotation string)

Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)
随机推荐
龙芯中科科创板上市:市值357亿 成国产CPU第一股
Final part of web crawler: send directional messages to 100000 Netease cloud users
Redis + guava local cache API combination, performance burst!
网易云信正式加入中国医学装备协会智慧医院分会,为全国智慧医院建设加速...
SAP Spartacus 中的依赖注入 Dependency Injection 介绍
不同的子序列问题I
Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)
About appium trample pit: encountered internal error running command: error: cannot verify the signature of (solved)
Treasure and niche cover PBR multi-channel mapping material website sharing
leetcode刷题:字符串02( 反转字符串II)
Dynamic parameter association using postman
How to install mysql8.0 database under Windows system? (Graphic tutorial)
VB.net类库——4给屏幕截图,裁剪
基于QT实现简单的连连看小游戏
How SAP Spartacus default routing configuration works
leetcode刷题:字符串05(剑指 Offer 58 - II. 左旋转字符串)
Looking back at the moon
DLA模型(分类模型+改进版分割模型) + 可变形卷积
【贝叶斯分类4】贝叶斯网
基于启发式搜索的一字棋