I got the following error when try to connect MySQl using MySQL.jl.
using MySQL, DBInterface
conn = DBInterface.connect(MySQL.Connection, "**", "root", "**"; port=3306) # the connection parameters are hide here
The error
DBInterface.NotImplementedError("`DBInterface.connect` not implemented for `MySQL.Connection`")
Stacktrace:
[1] #connect#1(::Base.Iterators.Pairs{Symbol,Int64,Tuple{Symbol},NamedTuple{(:port,),Tuple{Int64}}}, ::typeof(DBInterface.connect), ::Type, ::String, ::Vararg{String,N} where N) at /home/liye/.julia/packages/DBInterface/EUwXt/src/DBInterface.jl:14
[2] (::DBInterface.var"#kw##connect")(::NamedTuple{(:port,),Tuple{Int64}}, ::typeof(DBInterface.connect), ::Type, ::String, ::Vararg{String,N} where N) at ./none:0
[3] top-level scope at In[5]:1
The system information
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
I checked the source code of MySQL.jl. I found that DBInterface.connect is defined in MySQL.jl. However when call the API, only the version defined in DBInterface.jl is found.
>?DBInterface.connect
DBInterface.connect(DB, args...; kw...) => DBInterface.Connection
Database packages should overload DBInterface.connect for a specific DB DBInterface.Connection subtype that returns a valid, live database connection that can be queried against.
I Just found than the installed MySQL.jl is not the latest version. The installed version is 0.7.1. Only the higher version support DBInterface. But when I run > update MySQL
, the newer version still not installed. When I run >add https://github.com/JuliaDatabases/MySQL.jl.git
I got the package version conflicts as follows. Any one could help? Thanks!
(v1.3) pkg> add https://github.com/JuliaDatabases/MySQL.jl.git
Updating git-repo `https://github.com/JuliaDatabases/MySQL.jl.git`
Updating git-repo `https://github.com/JuliaDatabases/MySQL.jl.git`
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package DataFrames [a93c6f00]:
DataFrames [a93c6f00] log:
├─possible versions are: [0.11.7, 0.12.0, 0.13.0-0.13.1, 0.14.0-0.14.1, 0.15.0-0.15.2, 0.16.0, 0.17.0-0.17.1, 0.18.0-0.18.4, 0.19.0-0.19.4, 0.20.0-0.20.2] or uninstalled
├─restricted to versions * by nearmiss [82f5c312], leaving only versions [0.11.7, 0.12.0, 0.13.0-0.13.1, 0.14.0-0.14.1, 0.15.0-0.15.2, 0.16.0, 0.17.0-0.17.1, 0.18.0-0.18.4, 0.19.0-0.19.4, 0.20.0-0.20.2]
│ └─nearmiss [82f5c312] log:
│ ├─possible versions are: 0.1.0 or uninstalled
│ └─nearmiss [82f5c312] is fixed to version 0.1.0
├─restricted to versions 0.19.4 by an explicit requirement, leaving only versions 0.19.4
└─restricted by compatibility requirements with Tables [bd369af6] to versions: [0.11.7, 0.12.0, 0.13.0-0.13.1, 0.20.1-0.20.2] or uninstalled — no versions left
└─Tables [bd369af6] log:
├─possible versions are: [0.1.0-0.1.15, 0.1.17-0.1.19, 0.2.0-0.2.11, 1.0.0-1.0.3] or uninstalled
└─restricted to versions 1 by MySQL [39abe10b], leaving only versions 1.0.0-1.0.3
└─MySQL [39abe10b] log:
├─possible versions are: 1.0.1 or uninstalled
└─MySQL [39abe10b] is fixed to version 1.0.1
I use a new Julia environment, which is similar to that in Python. More details can be found in the document of Pkg.jl.
It is not convenient to active an environment and start jupyter using that env. Moreover, I need to start Jupyter from WSL with parameter of “–no-browser”. I cannot find how to set the parameter in using IJulia; notebook()