8 Replies Latest reply on Dec 9, 2014 6:23 AM by MorkAfur

    Writing FM data to MySQl Database



      Writing FM data to MySQl Database


      I've successfully connected FM with my MySQL db using ODBC and can now select tables from the MySQL db in FM's relational graph. I was wondering how I can write the data from my existing FM file to the MySQL db using ODBC, can anybody help me on this? I would like to display the data in some MySQL tables so I can fetch them using php on my website.

      So to be clear, the only purpose of the connection is to view the data online on the frontend of my Wordpress Site, no editing or whatever. The editing and maintenance of the database happens in FM and FM only.


        • 1. Re: Writing FM data to MySQl Database

          just create a layout based on your mysql table and create/edit the data as it would be a native filemaker table.


          • 2. Re: Writing FM data to MySQl Database

            Yeah I understand that part, but I think my situation is different because I have an existing filemaker server database that I would like to sync to the MySQL database.

            Im not starting from scratch, in that case I'd be able to select a layout based on my MySQL table like you suggested.

            Also, were working over Filemaker Server, and FM Server gives an error after entering the correct user and password info:

            ODBC Error: [Microsoft][ODBC-driver] The architecture of the driver and the program do not match the given DSN

            Do I need to fix something in FM server in order to make this work correctly?



            • 3. Re: Writing FM data to MySQl Database

              so you can access the mysql tables in your filemaker solution, though you´re getting this error message, right? maybe check the 32-bit vs. the 64-bit version of the mysql-odbc-driver.

              if you want to sync your fm tables to the mysql tables, i would suggest writing your own sync-scripts or buy third-party software like SyncDeK.


              • 4. Re: Writing FM data to MySQl Database

                That's not 100% the situation I guess, let me elaborate a little bit more.

                1. I setup the ODBC driver on the windows server
                3. when I tried to select the driver in external sources in FM, nothing showed up, I found out this was because I had the file running over FM Server.
                5. I stopped the FM Server DB and edited the file 'offline'. Now the ODCB source showed up in the external sources setup dialog!
                7. After setting everything up in FM Pro and adding one test table from the MySQL DB to the relational graph, I exited the file and started FM Server again.
                9. Now when I open the file remotely (with FM Server off-course) and I select the MySQL layout of the test table I get prompted to enter the MySQL credentials (can I avoid this with some setting or something?). I Enter the correct credentials and the error shows above pops up. The MySQL Layout gives erros on the fields saying the source is not available.

                I used this tutorial to setup the connection: http://www.milanm.com/?p=491

                I hope this makes it a little bit more clear for you?

                Do you have some tips for those scripts? or a manual somewhere? I cant seem to find any on that topic



                • 5. Re: Writing FM data to MySQl Database

                  sounds to me, like you configured an "user dsn" instead of a  "system dsn" as an odbc-source. filemaker server needs "system dsn" configs to provide the external sql sources to filemaker pro clients. filemaker pro on the other hand is able to connect via an "user dsn", if the file is opened locally.



                  • 6. Re: Writing FM data to MySQl Database

                    That's possible! I deleted the user DSN and setup system DSN with the ODBC program mentioned in the tutorial I posted in my last post. 

                    It's up and running but I cannot see it in FM's  'external datasource' > new > ODBC > specify DSN. it's empty....

                    Again, when I try to do it with a non FM server file, the data source appears in the list.

                    What am I missing?

                    • 7. Re: Writing FM data to MySQl Database

                      if you have configured an "system-dsn" with the mysql connector an the tested it with the result "connection successful" within the odbc data source configuration, every hosted filemaker-file on this server should list this odbc data sources from this server. in case, try to disable the firewall.

                      btw: there ist no need to enable odbc sharing or setup extended privileges (fmxdbc) in your filemaker solution referring to your posted link, because this ist just for using filemaker as an odbc data source.


                      • 8. Re: Writing FM data to MySQl Database

                        Why not just use JDBC. No ODBC setup necessary! :)

                        JDBC runs on all platforms.

                        I use JDBC to connect to FMP all the time.

                        Use an IDE that supports JDBC like Eclipse or Intellij IDEA.