From 7f2f0b624a76872442030e16659caa1322bf4937 Mon Sep 17 00:00:00 2001 From: "apurvis@lumoslabs.com" Date: Thu, 27 Jul 2017 13:56:48 -0400 Subject: [PATCH] Better troubleshooting docs; add support for percona --- README.md | 12 +++++------- src/config.jl | 7 +++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 4f01e61..dfd90b1 100644 --- a/README.md +++ b/README.md @@ -116,16 +116,14 @@ If `MYSQL_TUPLES` are passed as the last argument, then tuples will be returned # How to solve MySQL library not found error This error may occur during `using MySQL`. To resolve this- -* Ubuntu: Just add the MariaDB/MySQL .so file to lib_choices array in src/config.jl. If it is already there -make sure LD_LIBRARY_PATH contains the MariaDB/MySQL .so file directory path. Usually this is something like -`/usr/local/lib/mariadb/`. -* OSX: Same as above. In this case the file will be something like libmysqlclient.dylib. -* Windows: The file will be picked up automatically if MySQL is installed correctly. If you still get the error add the location of libmysql.dll to PATH. +* **Ubuntu**: Just add the MariaDB/MySQL `.so` file to the `lib_choices` array in `src/config.jl` (the system file is at `~/.julia/v0.7/MySQL/src/config.jl`). If it is already there make sure `LD_LIBRARY_PATH` contains the MariaDB/MySQL `.so` file directory path. Usually this is something like `/usr/local/lib/mariadb/`. +* **OSX**: Same as above. In this case the file will be something like `libmysqlclient.dylib`. Homebrew users should look in `/usr/local/Cellar/mysql`. +* **Windows**: The file will be picked up automatically if MySQL is installed correctly. If you still get the error add the location of `libmysql.dll` to PATH. # Tests -To run the tests you must have MySQL server running on the host. Set the constants HOST and ROOTPASS -in test/runtests.jl to the host and root password on your test setup. Run the tests using: +To run the tests you must have MySQL server running on the host. Set the constants HOST and ROOTPASS +in `test/runtests.jl` to the host and root password on your test setup. Run the tests using: ``` Pkg.test("MySQL") ``` diff --git a/src/config.jl b/src/config.jl index e7de476..750639e 100644 --- a/src/config.jl +++ b/src/config.jl @@ -1,8 +1,8 @@ # This snippet is taken from https://github.com/Dynactionize/MariaDB.jl -# This the configuration file for finding the shared object (dll) file +# This the configuration file for finding the shared object (dll) file # for MySQL/MariaDB API. Make sure to add the location of the files to # path for this to work. -# +# # TODO: Need to update lib_choices for Mac OS X and Windows. let @@ -12,7 +12,7 @@ let @static is_linux() ? (lib_choices = ["libmysql.so", "libmysqlclient.so", "libmysqlclient_r.so", "libmariadb.so", "libmysqlclient_r.so.16"]) : nothing - @static is_apple() ? (lib_choices = ["libmysqlclient.dylib"]) : nothing + @static is_apple() ? (lib_choices = ["libmysqlclient.dylib", "libperconaserverclient.dylib"]) : nothing @static is_windows() ? (lib_choices = ["libmysql.dll", "libmariadb.dll"]) : nothing local lib for lib in lib_choices @@ -26,4 +26,3 @@ let @eval const mysql_lib = $lib end end -