Mac OS安装使用ODBC

本文介绍了如何在Mac OS环境下安装并使用ODBC连接到MySQL RDS数据库。由于Mac OS缺少ODBC管理组件,需要额外安装MySQL ODBC驱动和ODBC Manager。详细步骤包括下载安装驱动和管理器,通过配置ODBC Manager添加数据库信息,并解决配置文件保存问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

需要用到JMP连接数据库,我们的数据库是RDS(MySQL),在windows环境安装MySQL ODBC驱动即可,可是Mac OS下就比较复杂,因为Mac OS把ODBC管理组件去掉了,所以除了安装驱动外,还要安装管理包,然后做些修改,因为这个第三方的ODBC管理器版本很旧而且有bug。

1. 下载安装Mac OS MySQL ODBC驱动

MySQL :: Download Connector/ODBC

2. 下载安装ODBC Manager

http://www.odbcmanager.net/

3. 打开配置ODBC Manager,添加RDS数据库信息,点Add Keyword,添加3个keyword,然后修改为SERVER, PORT, DATABASE, value栏位填入对应的信息,这个时候发现这些value有些不能保存,因此可以通过打开其背后的ini文件直接编辑,路径为:System DSNs: /Library/ODBC/odbc.ini,而不是这个User DSNs:~/Library/ODBC/odbc.ini

具体步骤如下,参考: https://docs.snowflake.net/manuals/user-guide/odbc-mac.html

Configure the ODBC Driver

To configure the ODBC driver for Mac OS, create one or more data source (DSNs), which are stored in the following files, depending on the type of DSN you create:


•User DSNs: ~/Library/ODBC/odbc.ini
•System DSNs: /Library/ODBC/odbc.ini

To create a DSN, either use ODBC Manager or edit the appropriate odbc.ini file.

Creating a DSN Using ODBC Manager

To create a DSN in ODBC Manager:

1.Start ODBC Manager.

2.Click on User DSN or System DSN.

3.Click the Add button.

4.Select the driver to use (Snowflake) and click OK.

5.Enter the name of the DSN and optionally a description.

6.Create a Keyword/Value pair for each DSN parameter:

1.Click Add to create a Keyword/Value pair.
2.Select Keyword and replace it with the parameter name.
3.Select Value and replace it with the value for the parameter.

Repeat this process for each parameter. For details about the parameters that can be set for each DSN, see ODBC Configuration and Connection Parameters.

7.Click OK to create the DSN.

If you are creating the first user or system DSN for the ODBC driver, ODBC Manager creates the odbc.ini file in the corresponding directory for the type of DSN you are creating. If you are creating additional DSNs, ODBC Manager adds entries for each DSN to the existing odbc.ini file.

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值