Skip to content

Instantly share code, notes, and snippets.

@mldeveloper01
Forked from arvsrao/odbc_setup_macos.md
Created March 8, 2021 07:16
Show Gist options
  • Select an option

  • Save mldeveloper01/4f20ef6a6eda55037be4d5c59d02721a to your computer and use it in GitHub Desktop.

Select an option

Save mldeveloper01/4f20ef6a6eda55037be4d5c59d02721a to your computer and use it in GitHub Desktop.

Revisions

  1. @arvsrao arvsrao revised this gist Apr 22, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions odbc_setup_macos.md
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@ Since I spent essentially two full days figuring out how to access a corporate M

    These instructions and the commands that follow, were executed on a MAC OS 10.8.3 system. Additionally, I found this blog [post][1] especially helpful during the debugging process.

    On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC][2]. Look elsewhere for a discussion about the differences between these diver manager. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing, the pyodbc requires iODBC as its manager.
    On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC][2]. Look elsewhere for a discussion about the differences between these driver managers. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing [pyodbc][3] requires iODBC as its manager.

    Start by installing freeTDS libraries. FreeTDS allows unix programs to talk natively to MS SQL and SyBase databases.
    Start by installing freeTDS libraries. FreeTDS allows unix programs to talk natively with MS SQL and SyBase databases.

    brew intsall freetds

    @@ -34,7 +34,7 @@ The driver is setup, so now install pyodbc:
    Now try to hit your DB:

    import pyodbc as p
    blah = p.connect("DSN=mysql01;UID=username;PWD=password")
    conn = p.connect("DSN=mysql01;UID=username;PWD=password")

    Should resolve without a problem. See pyodbc [docs][3] for help with executing queries, etc.

  2. @arvsrao arvsrao revised this gist Apr 22, 2013. 1 changed file with 19 additions and 1 deletion.
    20 changes: 19 additions & 1 deletion odbc_setup_macos.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,25 @@ Under **# A typical Microsoft server** you'll see *host*, *port*, and *tds versi
    port = 1433
    tds version = 7.2 (for MS SQL 2008)

    asdfasdf
    Create `~/Library/ODBC/odbc.ini` and fill out the file like so:

    [MyDB]
    Description = Company MS SQL
    TDS_Version = 7.2
    Driver = /usr/local/lib/libtdsodbc.so
    Server = *********
    Port = 1433

    The driver is setup, so now install pyodbc:

    sudo pip install pyodbc

    Now try to hit your DB:

    import pyodbc as p
    blah = p.connect("DSN=mysql01;UID=username;PWD=password")

    Should resolve without a problem. See pyodbc [docs][3] for help with executing queries, etc.


    [1]: http://blog.nguyenvq.com/2013/04/06/guide-to-accessing-ms-sql-server-and-mysql-server-on-mac-os-x/
  3. @arvsrao arvsrao revised this gist Apr 22, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions odbc_setup_macos.md
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,7 @@ FreeTDS needs to be configured, so edit your freetds.conf in /usr/local/etc/ or
    nano ~/.freetds.conf

    Under **# A typical Microsoft server** you'll see *host*, *port*, and *tds version* variables. These and these only should be set.

    host = myserver.company.com
    port = 1433
    tds version = 7.2 (for MS SQL 2008)
  4. @arvsrao arvsrao revised this gist Apr 22, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions odbc_setup_macos.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,8 @@ Under **# A typical Microsoft server** you'll see *host*, *port*, and *tds versi
    host = myserver.company.com
    port = 1433
    tds version = 7.2 (for MS SQL 2008)

    asdfasdf


    [1]: http://blog.nguyenvq.com/2013/04/06/guide-to-accessing-ms-sql-server-and-mysql-server-on-mac-os-x/
  5. @arvsrao arvsrao revised this gist Apr 22, 2013. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion odbc_setup_macos.md
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,16 @@ On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend

    Start by installing freeTDS libraries. FreeTDS allows unix programs to talk natively to MS SQL and SyBase databases.

    brew intsall freetds
    brew intsall freetds

    FreeTDS needs to be configured, so edit your freetds.conf in /usr/local/etc/ or ~/.freetds.conf

    nano ~/.freetds.conf

    Under **# A typical Microsoft server** you'll see *host*, *port*, and *tds version* variables. These and these only should be set.
    host = myserver.company.com
    port = 1433
    tds version = 7.2 (for MS SQL 2008)


    [1]: http://blog.nguyenvq.com/2013/04/06/guide-to-accessing-ms-sql-server-and-mysql-server-on-mac-os-x/
  6. @arvsrao arvsrao revised this gist Apr 22, 2013. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion odbc_setup_macos.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,12 @@ Since I spent essentially two full days figuring out how to access a corporate M

    These instructions and the commands that follow, were executed on a MAC OS 10.8.3 system. Additionally, I found this blog [post][1] especially helpful during the debugging process.

    On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC][2]. Look elsewhere for a discussion about the differences between these diver manager. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing, the
    On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC][2]. Look elsewhere for a discussion about the differences between these diver manager. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing, the pyodbc requires iODBC as its manager.

    Start by installing freeTDS libraries. FreeTDS allows unix programs to talk natively to MS SQL and SyBase databases.

    brew intsall freetds



    [1]: http://blog.nguyenvq.com/2013/04/06/guide-to-accessing-ms-sql-server-and-mysql-server-on-mac-os-x/
  7. @arvsrao arvsrao renamed this gist Apr 22, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. @arvsrao arvsrao renamed this gist Apr 22, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. @arvsrao arvsrao revised this gist Apr 22, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion odbc_setup_macos
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,6 @@ These instructions and the commands that follow, were executed on a MAC OS 10.8.
    On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC][2]. Look elsewhere for a discussion about the differences between these diver manager. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing, the



    [1]: http://blog.nguyenvq.com/2013/04/06/guide-to-accessing-ms-sql-server-and-mysql-server-on-mac-os-x/
    [2]: http://www.unixodbc.org
    [3]: https://code.google.com/p/pyodbc/
  10. @arvsrao arvsrao revised this gist Apr 22, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion odbc_setup_macos
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ Since I spent essentially two full days figuring out how to access a corporate M

    These instructions and the commands that follow, were executed on a MAC OS 10.8.3 system. Additionally, I found this blog [post][1] especially helpful during the debugging process.

    On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC] [2]. Look elsewhere for a discussion about the differences between these diver manager. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing, the
    On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC][2]. Look elsewhere for a discussion about the differences between these diver manager. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing, the



  11. @arvsrao arvsrao created this gist Apr 22, 2013.
    11 changes: 11 additions & 0 deletions odbc_setup_macos
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    Since I spent essentially two full days figuring out how to access a corporate MS SQL database pythonicly, I figured I should leave some notes, for future reference and to aid other souls looking to do the same.

    These instructions and the commands that follow, were executed on a MAC OS 10.8.3 system. Additionally, I found this blog [post][1] especially helpful during the debugging process.

    On mac os, there is a default ODBC manager, iODBC. Other Unix based systems tend to use [unixODBC] [2]. Look elsewhere for a discussion about the differences between these diver manager. The only feature we care about is being able to connect to SQL databases through [pyodbc][3], and at the time of this writing, the



    [1]: http://blog.nguyenvq.com/2013/04/06/guide-to-accessing-ms-sql-server-and-mysql-server-on-mac-os-x/
    [2]: http://www.unixodbc.org
    [3]: https://code.google.com/p/pyodbc/