Welcome to the django-pyodbc wiki! Below are instructions for setting up a Mac to connect to a MS SQL Server database. Summary I'm using a Mac on Yosemite Version 10.10.1 trying to connect to a MS SQL Server database. I searched and couldn't find an updated detailed answer so here's a writeup that is mostly from this amazing article. I'm adding it on stackoverflow in case the link dies. The idea is that we'll have the following layers to setup/connect. Layers • PART 1 - pyodbc • PART 2 - freeTDS (can check with tsql) • PART 3 - unixODBC (can check with isql) • PART 4 - MS SQL (can check with a regular python program) Steps • Install Homebrew from - this is a package manager for Mac OSX. The article shows how to use another package manager 'MacPorts'. For my instructions, they're with homebrew. Basically homebrew has a folder 'cellar' that holds different versions of packages. Instead of modifying your normal files, it instead points to these homebrew packages. • We need to install Pyodbc: pip install pyodbc • Install FreeTDS with brew install freetds --with-unixodbc (FreeTDS is the driver that sits between the Mac ODBC and MS SQL Server, chart here shows which version of TDS you should be using based on your specific Microsoft Server version; e.g. Tds protocol 7.2 for Microsoft SQL Server 2008). • Configure freetds.conf file (The file should be in '/usr/local/etc/freetds.conf', which for Homebrew is a link to say '/usr/local/Cellar/freetds/0.91_2/etc', but yours might be somewhere different depending on version). I edited the global and added my database info to the end (for some reason 'tds version = 7.2' would throw an error, but still work, while 8.0 just works): [global] # TDS protocol version tds version = 8.0 [MYSERVER] host = MYSERVER port = 1433 tds version = 8.0 • Verify FreeTDS installed correctly with: tsql -S myserver -U myuser -P mypassword (you should see a prompt like this if it worked) locale is 'en_US.UTF-8' locale charset is 'UTF-8' using default charset 'UTF-8' 1> • Install unixODBC with brew install unixodbc. FreeTDS is a set of libraries that, when combined with the UnixODBC driver, allows your Linux server and applications to natively talk to a Microsoft SQL Server. This post is a followup to a recent post I wrote. The issue at hand is that data are stored on a SQL server (Microsoft Server 2005 or version 9 of MS SQL Server to be exact) and that I would like to send queries from a command line interface, either from Mac OS X or a Linux system. Unix free download - UNIX Console, Unix Utilities, UNIX Programming, and many more programs. Unix Terminal Teaches Mac OS X Users unlocks the powerful capabilities of Unix. FreeTDS is a set of libraries that one can use from UNIX based systems to natively talk to SQL Server. Download it from their stable release link to your Downloads folder (current version 0.91 as of writing). • Setup your unixODBC config files, which includes odbcinst.ini (driver configuration), and odbc.ini (DSN configuration file). By default, my files were in: /Library/ODBC (Note: NOT my user library aka /Users/williamliu/Library). Or they could also be in your homebrew installation directory /usr/local/Cellar/unixodbc//etc. • Open up your ' odbcinst.ini' file and then add the following (Note: Different if you use MacPorts. For Homebrew, this file is a link to the homebrew version e.g. Quake 3 Fortress 1.0b1G - Quake 3 mod enhances team play experience. Download the latest versions of the best Mac apps at safe and trusted MacUpdate Download, install, or update Quake 3 Fortress for Mac from MacUpdate. Download MacRemover and install it by dragging its icon to the application folder. Launch MacRemover in the dock or Launchpad, select Quake 3 Fortress 1.0b1G appearing on the interface, and click Run Analysis button to proceed. What's New in Quake 3 Fortress Version 2.3: We've completed six brand new maps for this build and included four updated maps from Beta 1. The Q3F 2.3 Public Beta also includes a number of squished bugs, many fixes to. If you also find there is an uninstall tool which belongs to the same developer with Quake 3 Fortress 1.0b1G, you also can choose to uninstall Quake 3 Fortress 1.0b1G via this remover. Download and install the specific uninstaller on your Mac. Quake 3 fortress 1.0b1g free download for mac. Hello, Not sure where the problem is lying. I've got this all working on CentOS but I had a few problems compiling FreeTDS (it compiles now, just static issues, so i'm pretty sure they're fixed) I can connect to my MS SqlServer via Tsql /freeTDS so i think that side of the wall is working. Zenmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. Google chrome free download for mac. Linux For MacThe problem seems to be in loading the driver (not sure if it's the driver itself or not) Any ideas? However, when I try to connect to the DB via isql, ultimately so i can use my php app. > Hello, Not sure where the problem is lying. I've got this all > working on CentOS but I had a few problems compiling FreeTDS (it > compiles now, just static issues, so i'm pretty sure they're fixed) > I can connect to my MS SqlServer via Tsql /freeTDS so i think that > side of the wall is working. > > The problem seems to be in loading the driver (not sure if it's the > driver itself or not) > > Any ideas? > > > > However, when I try to connect to the DB via isql, ultimately so i > can use my php app. Is there a way to know for sure which directory unixODBC is > looking for the ini files and the freetds.conf? Freetds Download Unix For Mac Os X![]() ![]() Unix$ odbcinst -j unixODBC 2.2.11 DRIVERS..: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini USER DATA SOURCES.: /home/radman/.odbc.ini unixODBC is not looking for freetds.conf, that's the FreeTDS drivers job. If you use FreeTDS solely through the ODBC driver I would recommend the ODBC-only configuration where you do not need freetds.conf but configure all FreeTDS parameters in odbc.ini: TES Cheers Stefan. > -----Original Message----- > From: > [mailto:] On Behalf Of > Philip Ives > Sent: Wednesday, 06 February, 2008 23:24 > To: Support for the unixODBC project > Subject: Re: [unixODBC-support] unixODBC + FreeTDS problems > on Mac OS X > > Ok, i resolved that error finally, but i'm back to iSQL not > finding my > dsn. Is there a way to know for sure which directory unixODBC is > looking for the ini files and the freetds.conf? > > Thanks in advance. > Phil > On Feb 6, 2008, at 2:34 PM, Philip Ives wrote: > > > Hello, Not sure where the problem is lying. I've got this all > > working on CentOS but I had a few problems compiling FreeTDS (it > > compiles now, just static issues, so i'm pretty sure > they're fixed) > > I can connect to my MS SqlServer via Tsql /freeTDS so i think that > > side of the wall is working.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |