an ODBC driver?
For example, if you want to analyse MySQL data in Excel, install the MySQL ODBC driver on the machine where Excel is installed.
To do this, execute the file distribution that you downloaded in the previous step, and follow the on-screen instructions.
The install program starts the Easysoft License Manager, because you cannot use your Easysoft product until a license is obtained.
The following types of license are available:
Complete the Name, E-Mail Address, and Company fields.
The E-Mail Address must be the same as the address used to register and download from the Easysoft web site or you will be unable to obtain trial licenses.
You're asked for a license type.
The License Manager asks what software you are licensing. Select your product from the drop-down list and then choose Next.
The License Manager requests your authorization code.
Enter the authorization code and then choose Next.
The License Manager then sends a request to the Easysoft license server to activate your license key automatically. This is the quickest method and results in your details being entered immediately into our support database.
Each of these methods involves providing Easysoft with information including your machine number (a number unique to your machine) and then waiting to receive your license key.
Instead of emailing your details to Easysoft, you can enter them directly at the Easysoft web site and your license key will be emailed to you automatically.
To use this method, choose View Request, and then visit:
In the licensing page, enter your machine number (and authorization code for a purchased license), choose Submit and your license key will be emailed to you.
When you receive the license key, you can activate it either by double-clicking the email attachment or by choosing Enter License on the License Manager main screen and pasting the license key into the dialog box.
The installation is complete.
Before you can use the MySQL ODBC driver to connect your application to MySQL, you need to configure an ODBC data source. An ODBC data source stores the connection details for the target database (in this case, MySQL) and the ODBC driver that is required to connect to it (in this case, the MySQL ODBC driver).
You configure ODBC data sources in ODBC Data Source Administrator, which is included with Windows. There are two versions of ODBC Data Source Administrator on this platform. The version of ODBC Data Source Administrator that you need to run depends on whether the application you want to connect to MySQL is 32-bit or 64-bit. For the applications covered in this article, refer to the following table to find out the application's architecture.
Application | Notes |
---|---|
Access | There is both a 32-bit and a 64-bit version of Access. To find out which version of Access you have, start Access, and then start Windows Task Manager. In Task Manager, choose the Processes tab. Search for MSACCESS.EXE in the list. If the process name is MSACCESS.EXE *32, Microsoft Access is 32-bit. If the process name is MSACCESS.EXE, Microsoft Access is 64-bit. |
Excel | There is both a 32-bit and a 64-bit version of Excel. To find out which version of Excel you have, start Excel, and then start Windows Task Manager. In Task Manager, choose the Processes tab. Search for Excel.exe in the list. If this process name is followed by *32, your version of Excel is 32-bit. Otherwise, your version of Excel is 64-bit. |
Oracle | The Oracle component that interacts with the MySQL ODBC driver is called DG4ODBC. There is both a 32-bit and a 64-bit version of DG4ODBC. To find out which version of DG4ODBC you have, start the Windows Task Manager and choose the Processes tab. In a Command Prompt window, type dg4odbc --help . In the Windows Task Manager, search for the DG4ODBC process. If the Image Name is dg4odbc.exe *32 DG4ODBC is 32-bit. If the Image Name is dg4odbc.exe DG4ODBC is 64-bit. Press CTRL+C in the Command Prompt window, when you have used the Windows Task Manager to find out DG4ODBC's architecture. |
SQL Server |
There is both a 32-bit and a 64-bit version of SQL Server. To find out which version of SQL Server you have, connect to your SQL Server instance, and then run this SQL statement:
|
If you have a 64-bit application, you need to run 64-bit version of ODBC Data Source Administrator. To do this, open Administrative Tools in Control Panel, and then open Data Sources (ODBC). (On Windows Server 2003 and earlier, the Control Panel applet that launches ODBC Data Source Administrator is labelled Data Sources. On Windows 8 and later, the Control Panel applet is labelled ODBC Data Sources (64-bit).)
If you have a 32-bit application, you need to run the 32-bit version of ODBC Data Source Administrator. To do this, in the Windows Run dialog box, enter:
%windir%\syswow64\odbcad32.exe
Use ODBC Data Source Administrator to create a MySQL ODBC driver data source:
Setting | Value |
---|---|
DSN | MYSQL |
User Name | The name of your MySQL user. |
Password | The password for your MySQL user. |
Server | The host name or IP address of the machine on which your MySQL server is running. |
Microsoft Access uses an ODBC driver to interact with an external data source. ODBC is a data access technology, the Microsoft implementation of which is included with Windows. You can use the MySQL ODBC driver to connect Microsoft Access to a MySQL Database, enabling you to retrieve and update MySQL data from a Microsoft Access front end.
The Link dialog box is displayed.
The Get External Data wizard starts.
The Get External Data wizard starts.
The Select Data Source dialog box is displayed.
The Link Tables dialog box is displayed.
Follow these steps to return data from MySQL to Microsoft Excel by using Microsoft Query:
The New Database Query command uses Microsoft Query to import data. Microsoft Query is an optional feature, which by default is not installed. If you do not have Microsoft Query installed, choosing New Database Query will prompt you to install it. To do this, in Control Panel, choose Programs and Features (or Add or Remove Programs). Choose Microsoft Office (if you installed Excel as part of Office) or Microsoft Excel, and then choose Change. Follow the instructions on screen. Select Choose advanced customization of applications during the Setup wizard if this option is present for your version of Office or Excel. Microsoft Query is located under Office Tools.
When you have installed Microsoft Query, repeat step 1.
SELECT * FROM employees
The following instructions show you how to connect Oracle on Windows to MySQL. For further information about DG4ODBC, refer to our DG4ODBC for Windows tutorial.
%ORACLE_HOME%\hs\admin
directory. Create a copy of the file initdg4odbc.ora
. Name the new file initmysql.ora
.
Note In these instructions, replace %ORACLE_HOME%
with the location of your Oracle HOME
directory. For example, C:\oraclexe\app\oracle\product11円.2.0\server
.
HS_FDS_CONNECT_INFO = my_mysql_odbc_dsn
Replace my_mysql_odbc_dsn
with the name of a MySQL ODBC driver data source that connects to the target MySQL server. For example:
HS_FDS_CONNECT_INFO = "32-bit MySQL System"
If your MySQL server does not require you to supply a user name and a password, include IgnoreAuth=Yes
in the HS_FDS_CONNECT_INFO
parameter value. For example:
HS_FDS_CONNECT_INFO = "32-bit MySQL System;IgnoreAuth=Yes"
HS_FDS_QUOTE_IDENTIFIER = FALSE
#HS_FDS_TRACE_LEVEL = <trace_level>
%ORACLE_HOME%\network\admin\listener.ora
that creates a SID_NAME
for DG4ODBC. For example:
SID_LIST_LISTENER = (SID_LIST = (SID_DESC= (SID_NAME=mysql) (ORACLE_HOME=%ORACLE_HOME%) (PROGRAM=dg4odbc) ) )
%ORACLE_HOME%\network\admin\tnsnames.ora
that specifies the SID_NAME
created in the previous step. For example:
MYSQL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle_host)(PORT = 1521)) (CONNECT_DATA = (SID = mysql) ) (HS = OK) )
Replace oracle_host
with the host name of your Oracle machine.
cd %ORACLE_HOME%\bin lsnrctl stop lsnrctl start
CREATE PUBLIC DATABASE LINK mysqllink CONNECT TO "my_mysql_user" IDENTIFIED by "my_mysql_password" USING 'mysql';
Or, if your MySQL server does not require you to supply a user name and a password:
CREATE PUBLIC DATABASE LINK mysqllink USING 'mysql';
%ORACLE_HOME%\hs\trace
directory. To enable DG4ODBC tracing, add the line HS_FDS_TRACE_LEVEL = DEBUG
to initmysql.ora
and then restart the Oracle listener. If the trace
directory does not exist, create it.TEMP
directory. For example, C:\Windows\Temp\SQL.log
.These steps show you how to use a linked server to work with MySQL data, just as if you were working with data stored in a SQL Server table:
You need to log on with an account that is a member of the SQL Server sysadmin
fixed server role to create a linked server.
The other provider options should be unchecked.
MYSQL
.SQL Server verifies the linked server by testing the connection.
PATH
environment variable. The MySQL ODBC driver Setup program adds entries for the driver to the System PATH
. Restarting the instance makes these changes available to SQL Server, allowing it to load the MySQL ODBC driver.A four part table name has the format:
server_name.[database_name].[schema_name].table_name
.
For MySQL, you need to omit the database name and schema. For example:
SELECT * FROM MYSQL...sales_by_film_category
OPENQUERY
function. For example:
SELECT * FROM OPENQUERY(MYSQL, 'SELECT * FROM sales_by_film_category')
SQL Server sends pass-through queries as uninterpreted query strings to the MySQL ODBC driver. This means that SQL Server does not apply any kind of logic to the query or try to estimate what that query will do.
Note The MySQL TEXT
data type is incompatible with SQL Server. If you attempt to retrieve a TEXT
column, you will get error such as "Requested conversion is not supported." or "Restricted data type attribute violation." To use TEXT
data in SQL Server, you need to convert the data in MySQL to a type that SQL Server does support. For example:
SELECT * FROM OPENQUERY(MYSQL, 'SELECT CAST(description AS char(255)) AS description from film where film_id = 1000')
These instructions assume that you have Microsoft Visual Studio and SQL Server Data Tools for Visual Studio installed.
.csv
file named film.csv
with the following contents:
film_id,title,description,release_year,language_id,original_language_id,rental_duration,rental_rate,length,replacement_cost,rating,special_features,last_update 1001,"Mad Max: Fury Road","Haunted by his turbulent past, Mad Max believes the best way to survive is to wander alone",2015,1,1,3,"4.99",50,"18.99","NC-17","Trailers,Commentaries,Behind the Scenes","2015-05-08 00:00:01" 1002,"Avengers: Age of Ultron","When Tony Stark tries to jumpstart a dormant peacekeeping program, things go awry",2015,1,1,3,"4.99",50,"18.99","NC-17","Trailers,Commentaries,Behind the Scenes","2015-05-08 00:00:01"
Flat File Source is under the Other Sources list.
.csv
file."
.database timestamp [DT_DBTIMESTAMP]
. Choose OK.Ignore failure
. Choose OK.ODBC Destination is in the Other Destinations list.
film
. Choose Mappings and then choose OK.film.csv
file into MySQL.