MySQL error while precompling

Hi all-

I am using Julia .5 on Ubuntu 16.04. When I try to use MySQL I get the following message. Is there something else I need to configure?

Thanks,

Chris

ERROR: LoadError: LoadError: MYSQL library not found
 in macro expansion; at /home/dfish/.julia/v0.5/MySQL/src/config.jl:25 [inlined]
 in anonymous at ./<missing>:?
 in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
 in macro expansion; at ./none:2 [inlined]
 in anonymous at ./<missing>:?
 in eval(::Module, ::Any) at ./boot.jl:234
 in process_options(::Base.JLOptions) at ./client.jl:239
 in _start() at ./client.jl:318
while loading /home/dfish/.julia/v0.5/MySQL/src/config.jl, in expression starting on line 8
while loading /home/dfish/.julia/v0.5/MySQL/src/MySQL.jl, in expression starting on line 8

You most likely need to install missing MySQL packages, as stated here. Though ideally the package would do this automatically for you.

Thanks. I did install MySQL but using a different set of instructions. So its possible I did not install it properly.

MySQL is installed properly as far as I can tell. The MySQL Julia page suggests manually configuring the config.jl file by inserting the path to the MySQL.so file. I could not find that anywhere on my computer and searching on google was not very helpful unfortunately. Does any one know where I can find this file?

Looks like it is (or must be created) in ~/.julia/MySQL/src/. The docs about this could probably be made more explicit.

Thanks. I agree that it was a little confusing because there are several config.jl files within Julia. However, I did find the correct config.jl file within the MySQL julia package. The problem I have encountered is adding the path of the MySQL.so file to the following code in the config.jl file:

@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_windows() ? (lib_choices = [“libmysql.dll”, “libmariadb.dll”]) : nothing

My understanding is that I need to add the full path to one of the file names in lib_choices, such as “libmysql.so” and also add a path to LD_LIBRARY_PATH . However, I cannot find any of those files on my system. Or am I just interpreting the instructions wrong? (my appologies for being dense. I’ve never had to deal with this aspect of MySQL)

Hopefully, one of the developers will automate this process. Its a bit cumbersome.

According to packages.ubuntu.com, the libmysqlclient20 package provides /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20, and the libmariadb2 provides /usr/lib/x86_64-linux-gnu/libmariadb.so.2 (if you are on 64-bit). You can also install the corresponding *-dev packages, and the default names should work.

Thanks for the lead. I’ll look into this and document what I find.

I have been facing the same issue and couldn’t figure out what to do. Could you please help me out here? Here it says the location is something like: /usr/local/lib/mysqldb/ but there’s no such directory.

@krudutta, unfortunately I was not able to get it to work on my system. I’m not very familiar with MySQL, so I probably won’t be very helpful. @nalimilan, may have some ideas.

What distribution are you using?