MySQL Connector/ODBC Developer Guide

2y ago
110 Views
3 Downloads
1.67 MB
104 Pages
Last View : 2m ago
Last Download : 3m ago
Upload by : Carlos Cepeda
Transcription

MySQL Connector/ODBC Developer Guide

AbstractThis manual describes how to install and configure MySQL Connector/ODBC, the driver that enables ODBCapplications to communicate with MySQL servers, and how to use it to develop database applications.MySQL Connector/ODBC 8.0 is recommended for use with MySQL Server 8.0, 5.7, and 5.6. Please upgrade toMySQL Connector/ODBC 8.0.For notes detailing the changes in each release of Connector/ODBC, see MySQL Connector/ODBC Release Notes.For legal information, see the Legal Notices.For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other MySQLusers.Licensing information.This product may include third-party software, used under license. MySQL Connector/ODBC 8.0 Community License Information User Manual has information about licenses relating to Connector/ODBCcommunity releases in the 8.0 release series. MySQL Connector/ODBC 8.0 Commercial License Information UserManual has information about licenses relating to Connector/ODBC commercial releases in the 8.0 release series.MySQL Connector/ODBC Community License Information User Manual has information about licenses relating toConnector/ODBC community releases up to and including version 5.3. MySQL Connector/ODBC Commercial LicenseInformation User Manual has information about licenses relating to Connector/ODBC commercial releases up to andincluding version 5.3.Document generated on: 2021-05-12 (revision: 69731)

Table of ContentsPreface and Legal Notices . v1 Introduction to MySQL Connector/ODBC . 12 Connector/ODBC Versions . 33 General Information About ODBC and Connector/ODBC . 53.1 Connector/ODBC Architecture . 53.2 ODBC Driver Managers . 74 Connector/ODBC Installation . 94.1 Installing Connector/ODBC on Windows . 104.1.1 Installing the Windows Connector/ODBC Driver Using the Zipped DLL Package . 114.2 Installing Connector/ODBC on Unix-like Systems . 134.2.1 Installing Connector/ODBC Using the MySQL Yum Repository . 134.2.2 Installing Connector/ODBC from a Binary Tarball Distribution . 134.2.3 Installing Connector/ODBC from a DEB Distribution . 144.2.4 Installing Connector/ODBC from an RPM Distribution . 154.3 Installing Connector/ODBC on macOS . 154.4 Building Connector/ODBC from a Source Distribution on Windows . 164.5 Building Connector/ODBC from a Source Distribution on Unix . 184.6 Building Connector/ODBC from a Source Distribution on macOS . 204.7 Installing Connector/ODBC from the Development Source Tree . 205 Configuring Connector/ODBC . 235.1 Overview of Connector/ODBC Data Source Names . 235.2 Connector/ODBC Connection Parameters . 245.3 Configuring a Connector/ODBC DSN on Windows . 315.3.1 Configuring a Connector/ODBC DSN on Windows with the ODBC Data SourceAdministrator GUI . 325.3.2 Configuring a Connector/ODBC DSN on Windows, Using the Command Line . 365.3.3 Troubleshooting ODBC Connection Problems . 365.4 Configuring a Connector/ODBC DSN on macOS . 375.5 Configuring a Connector/ODBC DSN on Unix . 405.6 Connecting Without a Predefined DSN . 405.7 ODBC Connection Pooling . 415.8 Getting an ODBC Trace File . 415.8.1 Enabling ODBC Tracing on Windows . 415.8.2 Enabling ODBC Tracing on macOS . 425.8.3 Enabling ODBC Tracing on Unix . 435.8.4 Enabling a Connector/ODBC Log . 436 Connector/ODBC Examples . 456.1 Basic Connector/ODBC Application Steps . 456.2 Step-by-step Guide to Connecting to a MySQL Database through Connector/ODBC . 466.3 Connector/ODBC and Third-Party ODBC Tools . 476.4 Using Connector/ODBC with Microsoft Access . 486.4.1 Exporting Access Data to MySQL . 486.4.2 Importing MySQL Data to Access . 516.4.3 Using Microsoft Access as a Front-end to MySQL . 536.5 Using Connector/ODBC with Microsoft Word or Excel . 596.6 Using Connector/ODBC with Crystal Reports . 616.7 Connector/ODBC Programming . 676.7.1 Using Connector/ODBC with Visual Basic Using ADO, DAO and RDO . 676.7.2 Using Connector/ODBC with .NET . 717 Connector/ODBC Reference . 777.1 Connector/ODBC API Reference . 77iii

MySQL Connector/ODBC Developer Guide7.2 Connector/ODBC Data Types .7.3 Connector/ODBC Error Codes .8 Connector/ODBC Notes and Tips .8.1 Connector/ODBC General Functionality .8.1.1 Obtaining Auto-Increment Values .8.1.2 Dynamic Cursor Support .8.1.3 Connector/ODBC Performance .8.1.4 Setting ODBC Query Timeout in Windows .8.2 Connector/ODBC Application-Specific Tips .8.2.1 Using Connector/ODBC with Microsoft Applications .8.2.2 Using Connector/ODBC with Borland Applications .8.2.3 Using Connector/ODBC with ColdFusion .8.2.4 Using Connector/ODBC with OpenOffice.org .8.2.5 Using Connector/ODBC with Pervasive Software DataJunction .8.2.6 Using Connector/ODBC with SunSystems Vision .8.3 Connector/ODBC and the Application Both Use OpenSSL .8.4 Connector/ODBC Errors and Resolutions (FAQ) .9 Connector/ODBC Support .9.1 Connector/ODBC Community Support .9.2 How to Report Connector/ODBC Problems or Bugs .iv8182858585868686868689909191919191979797

Preface and Legal NoticesThis manual describes how to install, configure, and develop database applications using MySQLConnector/ODBC, the driver that allows ODBC applications to communicate with MySQL servers.Legal NoticesCopyright 2005, 2021, Oracle and/or its affiliates.This software and related documentation are provided under a license agreement containing restrictionson use and disclosure and are protected by intellectual property laws. Except as expressly permittedin your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast,modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by anymeans. Reverse engineering, disassembly, or decompilation of this software, unless required by law forinteroperability, is prohibited.The information contained herein is subject to change without notice and is not warranted to be error-free.If you find any errors, please report them to us in writing.If this is software or related documentation that is delivered to the U.S. Government or anyone licensing iton behalf of the U.S. Government, then the following notice is applicable:U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integratedsoftware, any programs embedded, installed or activated on delivered hardware, and modifications ofsuch programs) and Oracle computer documentation or other Oracle data delivered to or accessed byU.S. Government end users are "commercial computer software" or "commercial computer softwaredocumentation" pursuant to the applicable Federal Acquisition Regulation and agency-specificsupplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure,modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including anyoperating system, integrated software, any programs embedded, installed or activated on deliveredhardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracledata, is subject to the rights and limitations specified in the license contained in the applicable contract.The terms governing the U.S. Government's use of Oracle cloud services are defined by the applicablecontract for such services. No other rights are granted to the U.S. Government.This software or hardware is developed for general use in a variety of information managementapplications. It is not developed or intended for use in any inherently dangerous applications, includingapplications that may create a risk of personal injury. If you use this software or hardware in dangerousapplications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and othermeasures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damagescaused by use of this software or hardware in dangerous applications.Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarksof their respective owners.Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarksare used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD,Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is aregistered trademark of The Open Group.This software or hardware and documentation may provide access to or information about content,products, and services from third parties. Oracle Corporation and its affiliates are not responsible for andexpressly disclaim all warranties of any kind with respect to third-party content, products, and servicesunless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and itsv

Documentation Accessibilityaffiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use ofthird-party content, products, or services, except as set forth in an applicable agreement between you andOracle.This documentation is NOT distributed under a GPL license. Use of this documentation is subject to thefollowing terms:You may create a printed copy of this documentation solely for your own personal use. Conversion to otherformats is allowed as long as the actual content is not altered or edited in any way. You shall not publishor distribute this documentation in any form or on any media, except if you distribute the documentation ina manner similar to how Oracle disseminates it (that is, electronically for download on a Web site with thesoftware) or on a CD-ROM or similar medium, provided however that the documentation is disseminatedtogether with the software on the same medium. Any other use, such as any dissemination of printedcopies or use of this documentation, in whole or in part, in another publication, requires the prior writtenconsent from an authorized representative of Oracle. Oracle and/or its affiliates reserve any and all rightsto this documentation not expressly granted above.Documentation AccessibilityFor information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program ility/.Access to Oracle Support for AccessibilityOracle customers that have purchased support have access to electronic support through My OracleSupport. For information, y/learning-support.html#support-tab.vi

Chapter 1 Introduction to MySQL Connector/ODBCThe MySQL Connector/ODBC is the name for the family of MySQL ODBC drivers (previously calledMyODBC drivers) that provide access to a MySQL database using the industry standard Open DatabaseConnectivity (ODBC) API. This reference covers Connector/ODBC 8.0, which includes the functionality ofthe Unicode driver and the ANSI driver.MySQL Connector/ODBC provides both driver-manager based and native interfaces to the MySQLdatabase, with full support for MySQL functionality, including stored procedures, transactions and fullUnicode compliance.For more information on the ODBC API standard and how to use it, refer to http://support.microsoft.com/kb/110093.The application development section of the ODBC API reference assumes a good working knowledge ofC, general DBMS, and a familiarity with MySQL. For more information about MySQL functionality and itssyntax, refer to https://dev.mysql.com/doc/.Typically, you need to install Connector/ODBC only on Windows machines. For Unix and macOS, youcan use the native MySQL network or named pipes to communicate with your MySQL database. You mayneed Connector/ODBC for Unix or macOS if you have an application that requires an ODBC interface tocommunicate with the database. Applications that require ODBC to communicate with MySQL includeColdFusion, Microsoft Office, and Filemaker Pro.For notes detailing the changes in each release of Connector/ODBC, see MySQL Connector/ODBCRelease Notes.Key Connector/ODBC topics include: Installing Connector/ODBC: Chapter 4, Connector/ODBC Installation. The configuration options: Section 5.2, “Connector/ODBC Connection Parameters”. An example that connects to a MySQL database from a Windows host: Section 6.2, “Step-by-step Guideto Connecting to a MySQL Database through Connector/ODBC”. An example that uses Microsoft Access as an interface to a MySQL database: Section 6.4, “UsingConnector/ODBC with Microsoft Access”. General tips and notes, including how to obtain the last auto-increment ID: Section 8.1, “Connector/ODBC General Functionality”. Application-specific usage tips and notes: Section 8.2, “Connector/ODBC Application-Specific Tips”. A FAQ (Frequently Asked Questions) list: Section 8.4, “Connector/ODBC Errors and Resolutions (FAQ)”. Additional Connector/ODBC support options: Chapter 9, Connector/ODBC Support.1

2

Chapter 2 Connector/ODBC VersionsThese are the versions of Connector/ODBC that are currently available: Connector/ODBC 8.0: adds MySQL Server 8.0 support, including caching sha2 password and therelated GET SERVER PUBLIC KEY connection attribute. For additional details, see the Connector/ODBC 8.0 release notes. Connector/ODBC 8.0: is the recommended version. Connector/ODBC 5.3: functions with MySQL Server versions between 4.1 and 5.7. It does notwork with 4.0 or earlier releases, and does not support all MySQL 8 features. It conforms to theODBC 3.8 specification and contains key ODBC 3.8 features including self-identification as a ODBC3.8 driver, streaming of output parameters (supported for binary types only), and support of theSQL ATTR RESET CONNECTION connection attribute (for the Unicode driver only). Connector/ODBC5.3 also introduces a GTK -based setup library, providing GUI DSN setup dialog on some Unix-basedsystems. The library is currently included in the Oracle Linux 6 and Debian 6 binary packages. Othernew features in the 5.3 series include file DSN and bookmark support; see the release notes for the 5.3series for details.Connector/ODBC 5.3.11 added caching sha2 password support by adding theGET SERVER PUBLIC KEY connection attribute. Connector/ODBC 5.2: upgrades the ANSI driver of Connector/ODBC 3.51 to the 5.x code base. It alsoincludes new features, such as enabling server-side prepared statements by default. At installationtime, you can choose the Unicode driver for the broadest compatibility with data sources using variouscharacter sets, or the ANSI driver for optimal performance with a more limited range of character sets. Itworks with MySQL versions 4.1.1 and higher. Connector/ODBC 5.1: is a partial rewrite of the of the 3.51 code base, and is designed to work withMySQL versions 4.1.1 and newer.Connector/ODBC 5.1: also includes the following changes and improvements over the 3.51 release: Improved support on Windows 64-bit platforms. Full Unicode support at the driver level. This includes support for the SQL WCHAR data type, andsupport for Unicode login, password and DSN configurations. For more information, see MicrosoftKnowledgebase Article #716246. Support for the SQL NUMERIC STRUCT data

Connector/ODBC community releases up to and including version 5.3. MySQL Connector/ODBC Commercial License Information User Manual has information about licenses relating to Connector/ODBC commercial releases up to and including version

Related Documents:

C. Shahabi 12 Database Interaction ODBC : ODBC (Open Database Connectivity) )provides a way for client programs (eg Visual Basic, Excel, Access, Q E etc) to access a wide range of databases or data sources ODBC stack )ODBC Application :Visual Basic, Excel, Access )Driver Manager :ODBC.DLL )ODBC Driver :ODBC Driver varie

Pervasive ODBC Client Interface - W3ODBCCI.DLL Pervasive ODBC Engine Interface - W3ODBCEI.DLL o MySQL driver MySQL ODBC 3.51 Driver - MYODBC3.DLL (MyODBC-3.51.11-2-win.msi - when used with MySQL version mysql-essential-4.1.13-win32.msi) MySQL 5 - MYODBC5.DLL o Splunk - SPLUNKDSII.

MySQL for Excel is a 32-bit add-in for Microsoft Excel, which you can install and run on Microsoft Windows. MySQL for Excel is not compatible with Linux or macOS. MySQL for Excel can interact with MySQL Workbench to simplify the management of MySQL connections when both MySQL client tools are installed.

Lifetime Support Oracle Premier Support Oracle Product Certifications MySQL Enterprise High Availability MySQL Enterprise Security MySQL Enterprise Scalability MySQL Enterprise Backup MySQL Enterprise Monitor/Query Analyzer MySQL Workbench MySQL Enterprise Edition. 11 MySQL Database

IBM DB2/UDB for zSeries 9.1 DB2 Client 9.1 Yes IBM Informix Dynamic Server 10.0 IBM Informix ODBC SDK 2.90 Yes DataDirect ODBC 5.3 (3) Yes IBM Informix Dynamic Server 11.1 IBM Informix ODBC SDK 3.50 Yes DataDirect ODBC 5.3 (3) Yes IBM Informix Dynamic Server 11.5 IBM Informix ODBC SDK 3.50 Yes DataDirect ODBC 5.3 (3) Yes

This manual describes how to install and configure MySQL Connector/Python, a self-contained Python driver for communicating with MySQL servers, and how to use it to develop database applications. MySQL Connector/Python 8.0 is highly recommended for use with MySQL Server 8.0, 5.7, and 5.6.

This is the developer guide for MySQL Connector/NET. Licensing information. This product may include third-party software, used under license. MySQL Connector/NET Community License Information User Manual has information about licenses relating to Connector/NET community releases up to and including version

or a small group of countries, we explore possible drivers behind the decline in income inequality in Latin America as a whole. To undertake this task, we utilize an array of methodologies—including correlation and econometric techniques. To start, we look at simple correlations between changes in policy variables and changes in income inequality