Skip to content

Commit

Permalink
Merge pull request #85 from apurvis/master
Browse files Browse the repository at this point in the history
Better troubleshooting docs; add support for percona libraries on OSX
  • Loading branch information
nkottary authored Jul 28, 2017
2 parents e86f103 + 7f2f0b6 commit 99da113
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
```
Expand Down
7 changes: 3 additions & 4 deletions src/config.jl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -26,4 +26,3 @@ let
@eval const mysql_lib = $lib
end
end

0 comments on commit 99da113

Please sign in to comment.