How to add ODBC to MAMP on OSX

I am trying to get ODBC to work on MAMP. I tried many suggestions and solutions, including already in stackoverflow:

MAMP: adding support for ODBC or SQL Server , How to add an ODBC driver to a MAMP environment?

So far no one has succeeded.

This is the last thing I've tried.

I downloaded the last ODBC connector: http://dev.mysql.com/downloads/connector/odbc/ Installed it using OSX DMG

I than add driver to iODBC

I keep getting this message:

A specific driver cannot be loaded

and

No matching image found. Found: /usr/local/lib/libmyodbc5w.so mach-o, but the wrong architecture

Any suggestions?

+8
php mamp odbc macos
source share
2 answers

It sounds like you're right about 32-bit iODBC only.

You will need to download the source code and compile it from scratch. You also need to download Xcode first through the AppStore so that you have access to gcc and cmake.

Source Code Link: http://www.iodbc.org/downloads/iODBC/libiodbc-3.52.7.tar.gz

Note. In the CLI, you can run the lipo -detailed_info /path/to/binary command. This will give you detailed information about the specified binary.

+4
source share

I struggled with this problem for MANY hours (I messed around with msql / php, and many years ago, so I consider myself a real newbie!). My problem was that I could not connect my computer to the new online server using ODBC (the server was Mac mini, working with mavericks, trying to connect from a Windows machine in my office through the mysql odic connector). I finally found a solution that works. here is my situation and environment:

  • I am transitioning from Access to MySql / PHP. The application is configured as front-end / back-end.

  • Put my server on the network so that I can export access tables back to MYSQL. (some of them were on the network on another server, some of them were on my internal Windows 2003 server). Planning to change the frontend to php from vba access.

  • Installed ODBC administrator for Mac mini (mavericks) for Google search.

  • Switch to the drivers tab in the ODBC Administrator. Install my drivers from USER to SYSTEM in the drop-down list on the drivers page. This opened the drivers to display on the "SYSTEM" tab of the ODBC administrator (before that, the drivers did not appear on the "SYSTEM" tab of the ODBC administrator).

  • Added variables DSN, USER, PORT and PASSWORD.

  • Then I went to a MAMP application that ran on a Mac. I pressed [FILE], [EDIT] [TEMPLATE] [my.cnf]. This opened the configuration file. Warning - if it is dirty, it spins the entire MAMP application.

  • I made the following change (added comment above change).

    The link address was just commented. 9-5-14

bind-address = 127.0.0.1

This change does not bind MAMP to the local host (I believe).

  • I continued to scroll through the file. I also made the following change and then saved the .cnf file:

    Just commented on the next line. Trying to get odbc to work. 9-5-14

MAMP_skip-networking_MAMP

This change, which I believe, says MAMP, which allows remote connections.

  • On the PC, in the "Data Sources", "System DSN" section, using the MYSQL ODBC 5.1 driver, I set the name of the data source, I set the URL of the online server (which was registered using internic), I installed the port, and I entered User and password should be the same KEYS that I installed in the DSBC ODBC systems that I added on the Mac server. Then I removed the database tab and miraculously appeared the databases on my Mac server!

Hope this helps another newbie! I literally worked WAY for too many hours trying to find a solution, and it ended pretty easily as soon as I got lucky in return! .

+1
source share

All Articles