10bet网址
MySQL Connector/ODBC Developer Guide
Related Documentation Download this Manual
PDF (US Ltr)- 1.7Mb
PDF (A4)- 1.7Mb


MySQL Connector/ODBC Developer Guide/.../ Configuring a Connector/ODBC DSN on Windows with the ODBC Data Source Administrator GUI

5.3.1 Configuring a Connector/ODBC DSN on Windows with the ODBC Data Source Administrator GUI

TheODBC Data Source Administratoron Windows lets you create DSNs, check driver installation, and configure ODBC functions such as tracing (used for debugging) and connection pooling. The following are steps for creating and configuring a DSN with theODBC Data Source Administrator:

  1. Open theODBC Data Source Administrator.

    Different editions and versions of Windows store theODBC Data Source Administratorin different locations. For instructions on opening theODBC Data Source Administrator, see the documentation for you Windows version;these instructionsfrom Microsoft cover some popuar Windows platforms. You should see a window similar to the following when you open theODBC Data Source Administrator:

    Figure 5.1ODBC Data Source AdministratorDialog

    Shows an example ODBC Data Source Administrator dialog with the default

  2. To create a System DSN (which will be available to all users), select theSystem DSNtab. To create a User DSN, which will be available only to the current user, click theAdd...button to open the "Create New Data Source" dialog.

  3. 从"Create New Data Source" dialog, select the MySQL ODBC 5.xANSI or Unicode Driver, then clickFinishto open its connection parameters dialog.

    Figure 5.2 Create New Data Source Dialog: Choosing a MySQL ODBC Driver

    Content is described in the surrounding text.

  4. You now need to configure the specific fields for the DSN you are creating through theConnection Parametersdialog.

    Figure 5.3Data Source ConfigurationConnection Parameters Dialog

    Content is described in the surrounding text.

    In theData Source Namebox, enter the name of the data source to access. It can be any valid name that you choose.

    Tip

    To identify whether a DSN was created using the 32-bit or the 64-bit driver, include the driver being used within the DSN identifier. This will help you to identify the right DSN to use with applications such as Excel that are only compatible with the 32-bit driver. For example, you might addUsing32bitCODBCto the DSN identifier for the 32-bit interface andUsing64bitCODBCfor those using the 64-bit Connector/ODBC driver.

  5. In theDescriptionbox, enter some text to help identify the connection.

  6. In theServerfield, enter the name of the MySQL server host to access. By default, it islocalhost.

  7. In theUserfield, enter the user name to use for this connection.

  8. In thePasswordfield, enter the corresponding password for this connection.

  9. TheDatabasepop-up should be automatically populated with the list of databases that the user has permissions to access.

  10. To communicate over a different TCP/IP port than the default (3306), change the value of thePort.

  11. ClickOKto save the DSN.

To verify the connection using the parameters you have entered, click theTestbutton. If the connection can be made successfully, you will be notified with aConnection Successfuldialog; otherwise, you will be notified with aConnection Faileddialog.

You can configure a number of options for a specific DSN by clicking theDetailsbutton.

Figure 5.4 Connector/ODBC Connect Options Dialog

Content is described in the surrounding text.

Toggling theDetailsbutton opens (or closes) an additional tabbed display where you set additional options that include the following:

  • Connections,Metadata, andCursors/Resultsenable you to select the additional flags for the DSN connection. For more information on these flags, seeSection 5.2, “Connector/ODBC Connection Parameters”.

    Note

    For the Unicode version of Connector/ODBC, due to its native Unicode support, you do not need to specify the initial character set to be used with your connection. However, for the ANSI version, if you want to use a multibyte character set such as UTF-16 or UTF-32 initially, specify it inCharacter Setbox; however, that is not necessary for using UTF-8 or UTF-8-MB4 initially, because they do not contain\0bytes in any characters, and therefore the ANSI driver will not truncate the strings by accident when finding\0bytes.

  • Debuglets you turn on ODBC debugging to record the queries you execute through the DSN to themyodbc.sqlfile. For more information, seeSection 5.8, “Getting an ODBC Trace File”.

  • SSLconfigures the additional options required for using the Secure Sockets Layer (SSL) when communicating with MySQL server.

    图5.5连接器/ ODBC连接选项对话框:SSL Options

    Content is described in the surrounding text.

    You must also enable and configure SSL on the MySQL server with suitable certificates to communicate using it using SSL.