Cara menggunakan cara setting odbc mysql

We strongly recommend using to connect to databases, and this is what we demonstrate in the code samples.

Follow these steps to connect:

  1. Create a new channel to try out the code:
    • Create a channel like this:
      • Name: DB MySQL Connection (or similar)
      • Source: From Translator
      • Destination: To Channel
    • Alternatively use an existing channel:

      Your channel will need a From/To Translator or a Filter component.

  2. Connect to a database using ODBC:
    • Paste this code into the Translator:

      If your script uses connection object methods conn:query{} or conn:execute{}to connect to a remote MySQL database, the location of the remote host is specified as part of the name parameter in the db.connect{ } command. If you use conn:merge{} to connect the remote host is specified as part of the name parameter in the conn:merge{} command itself.

      function main()
            local conn = db.connect{   
            api=db.MY_SQL_ODBC, 
            name='your_odbc_server_name',
            user='your_login',
            password='secret',
            use_unicode = true,
            live = true
         }
      
         conn:execute{sql='SELECT * FROM <your table>', live=true}
      end
    • The name is the name of an ODBC source that you create using the ODBC Administrator.
  3. Adapt the code to your requirements.
Setup ODBC []

Note: Iguana may not always support the very latest version of MySQL ODBC, so you can simply download an earlier version if necessary. This is particularly true if you are not able to use the the latest version of Iguana.

If you need to know which versions of MySQL are supported by the version of Iguana you are using please contact us at [email protected].

To set up a new ODBC data source for MySQL Server:

  1. Install the latest MySQL ODBC drivers:
    1. Download and install the :

      At the time this was written you specifically need the 2015 redistributable, and using the 2017 redistributable did not work. Future versions of the MySQL ODBC drivers may be compatible with the 2017 redistributable — check the MySQL ODBC documentation.

      • If you have installed a later version of the redistributable (like 2017) you will need to uninstall it first:

        The 2015 installer will not install if it finds that a later redistributable version (like 2017) is already installed. You may wish try the 2015 redistributable install without uninstalling first in case this behaviour has changed.

      • Run the 2015 redistributable installer and accept the defaults.
      • If you need the later version of the redistributable (like 2017) you can install it again:

        You can now safely re-install the later (like 2017) redistributable if you have other programs that depend on it.

    2. Download the latest MySQL installer from the MySQL download site:

      There was no separate ODBC installer for MySQL (at the time of writing). You will need to download the full MySQL installer, and choose the custom option when you run the installer.

    3. Run the installer and accept the defaults, until you get to the Choosing a Setup Type page.
    4. Choose the Custom option:

      You can choose any another option if you wish, as they all include the ODBC drivers. For example you might choose the Client Only option to install all the client tools (and all drivers).

      Cara menggunakan cara setting odbc mysql

    5. Click Next.
    6. Expand the MySQL Connectors and select 64 bit ODBC, then press the green arrow:
      Cara menggunakan cara setting odbc mysql
    7. Click Next, then Execute, then Next, then Finish.
  2. Open the 64 bit ODBC Administrator:

    Windows 10 (64 bit version) supports 32 and 64 bit ODBC sources — always use the 64 bit ODBC Administrator.

    • Search for ODBC and choose ODBC Data Sources (64 bit):
      Cara menggunakan cara setting odbc mysql
    • Right Click and choose Run as Administrator:
      Cara menggunakan cara setting odbc mysql
  3. Open the System DSN tab and click Add:
    Cara menggunakan cara setting odbc mysql
  4. Choose the latest MySQL ODBC driver and click Finish:
    Cara menggunakan cara setting odbc mysql
  5. Enter the ODBC credentials:
    • Use any Data Source Name and Description you prefer.
    • Enter the Network Name (or IP) of the MySQL Server in the TCP/IP Server field:
      Note: If you are unsure of this ask your DBA (database administrator).
    • Enter the User name and Password:
      Note: If you are unsure of these ask your DBA (database administrator).
    • Optional: Choose your default Database:
      Cara menggunakan cara setting odbc mysql
  6. Test the data source connection:
    • Click Test Data Source…:
      Cara menggunakan cara setting odbc mysql
    • And if it works you are good to go:
      Cara menggunakan cara setting odbc mysql
    • Click OK to create the ODBC data source:
      Cara menggunakan cara setting odbc mysql
  7. If the connection does not work speak to your DBA (database administrator) about how to login to the database (user authentication).
Troubleshooting []
  • Problems with connection settings:

    Speak to your DBA (database administrator) for general connection issues like: User name and password, Database Server network name etc.

  • Iguana may not always support the very latest version of the ODBC drivers:

    Please contact us at [email protected] if you need to know the latest supported version of the ODBC drivers.

  • The ODBC install fails:

    This is probably because you need to install the the . You will need uninstall any later versions (like 2017) of the redistributable before you can install the 2015 version (you can re-install the later version immediately installing 2015), see the step (1.1) of  above. NOTE: Using the 2017 redistributable does not work (you specifically need 2015 as well). Future versions of the MySQL ODBC drivers may be compatible with the 2017 redistributable — you will need to check the MySQL ODBC documentation.

  • Incorrect port number:

    MySQL defaults to port 3306, but a different port can be used. Speak to your database administrator (DBA) or network administrator.

    Untuk apa dilakukan konfigurasi data source name?

    1) Data Source Name berfungsi untuk memberikan nama yang akan diberikan pada proses mengakses database.

    Apa itu koneksi ODBC?

    Konektivitas Database Terbuka (ODBC) adalah protokol yang dapat Anda gunakan untuk menyambungkan database Microsoft Access ke sumber data eksternal, seperti Microsoft SQL Server. Artikel ini berisi informasi umum tentang sumber data ODBC, cara membuatnya, dan cara menyambungkannya menggunakan Microsoft Access.