It doesn't look like it is included in the most recent GDAL-Complete framework. Please file a request with kyngchaos.com.
In the meantime, if you don't mind trying it yourself, you can attempt to build a shared plugin for GDAL 1.10, install it, and see if it works with your data source:
Ensure you have XCode and/or its command line tools installed.
Download and install latest MySQL Community Server (installs to /usr/local/mysql
).
Download the GDAL source and un-archive to folder, e.g. gdal-1.10.1
, and enter it.
$ cd /path/to/gdal-1.10.1
Edit a single source file and comment-out unsupported symbols in MySQL 5.6+ client
ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp @ line 130
/* -------------------------------------------------------------------- */
/* Use options process to get .my.cnf file contents. */
/* -------------------------------------------------------------------- */
int nPort = 0, i;
char **papszTableNames=NULL;
std::string oHost, oPassword, oUser, oDB;
// char *apszArgv[2] = { (char*) "org", NULL };
// char **papszArgv = apszArgv;
// int nArgc = 1;
// const char *client_groups[] = {"client", "ogr", NULL };
my_init(); // I hope there is no problem with calling this multiple times!
// load_defaults( "my", client_groups, &nArgc, &papszArgv );
//
// for( i = 0; i < nArgc; i++ )
// {
// if( EQUALN(papszArgv[i],"--user=",7) )
// oUser = papszArgv[i] + 7;
// else if( EQUALN(papszArgv[i],"--host=",7) )
// oHost = papszArgv[i] + 7;
// else if( EQUALN(papszArgv[i],"--password=",11) )
// oPassword = papszArgv[i] + 11;
// else if( EQUALN(papszArgv[i],"--port=",7) )
// nPort = atoi(papszArgv[i] + 7);
// }
//
// // cleanup
// free_defaults( papszArgv );
Build shared plugin, in Terminal:
# make directory for build output
$ mkdir ogr_plugins
# compile shared plugin, statically linking in libmysqlclient (multi-line, single command)
$ g++ -Wall -g ogr/ogrsf_frmts/mysql/*.c* \
-shared -o ogr_plugins/ogr_MySQL.dylib /usr/local/mysql/lib/libmysqlclient.a \
-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/mysql \
-I/Library/Frameworks/GDAL.framework/Headers -I/usr/local/mysql/include \
-framework GDAL -lz -install_name ogr_MySQL.dylib
*/ #just closing comment for SE syntax highlighting
# copy plugin to known GDAL_DRIVER_PATH (sudo needed)
$ cd ogr_plugins
$ sudo cp -f ogr_MySQL.dylib /Library/Application\ Support/GDAL/1.10/PlugIns/
Verify plugin:
$ cd /path/to/gdal-1.10.1
$ otool -L ogr_plugins/ogr_MySQL.dylib
ogr_plugins/ogr_MySQL.dylib:
ogr_MySQL.dylib (...)
/Library/Frameworks/GDAL.framework/Versions/1.10/GDAL (...)
/usr/lib/libz.1.dylib (...)
/usr/lib/libstdc++.6.dylib (...)
/usr/lib/libSystem.B.dylib (...)
$ ogrinfo --formats | grep 'MySQL'
-> "MySQL" (read/write)
Launch QGIS and verify plugin loading in PyQGIS console:
from osgeo import ogr
sorted([ogr.GetDriver(drv).name for drv in range(0,ogr.GetDriverCount())])
You should be able to connect to a MySQL data source via Add Vector > Database > ...
now.
Please note, I don't have any geospatial MySQL data sources, so was unable to test the plugin I built.