# Import system modules import arcpy from arcpy import env import MySQLdb import sys # open a database connection try: connection = MySQLdb.connect(host="host.org", user="abcde", passwd="12345", db="waterdb") if connection.open: print "open" # Set environment settings # I believe this should reference the MySQL database but I don't know how env.workspace = "" # the table I want to convert table = arcpy.ListTables(["vwComboFlows"]) # Set local variables outLocation = "C:/output/output.mdb" try: # Execute TableToGeodatabase print "Importing tables to mdb: " + outLocation arcpy.TableToGeodatabase_conversion(table, outLocation) except: print arcpy.GetMessages()
Hey did you ever resolve this? I'd prefer not to have to use python-mysqldb for this but the process to set up an OLE DB Connection is incredibly onerous and not exposed to ArcPy.