来自documentation这个司机看起来很棒。我不知道如何安装它以便我可以使用它。我在某处读到我可能应该使用 rebar?我查看了该文档,但似乎存在相反的问题。它说明了如何安装它,但没有说明如何使用它。
<小时/>更新
所以看起来安装钢筋后,我可以添加线条
{deps, [
{mysql, ".*", {git, "https://github.com/mysql-otp/mysql-otp",
{tag, "1.3.3"}}}
]}.
到我的文件 rebar.config。我不知道这是做什么的。我现在必须编译或制作这个文件吗? rebar.config 必须与我的项目位于同一目录中吗?正确的不是 rebar.config 的路径是 ~/rebar/rebar.config
将我的项目放置在文件层次结构中使其成为 rebar 的同级项目是否正确?
更新
我使用 rebar 文件夹运行 ./rebar get-deps
并得到了
Pulling mysql from {git,"https://github.com/mysql-otp/mysql-otp",
{tag,"1.3.3"}}
Cloning into 'mysql'...
==> mysql (get-deps)
我仍然不知道这意味着什么,当我尝试编译我的 erlang 文件时,我收到了结果。
c(erlangFile.erl).
{error,non_existing}
最佳答案
rebar是erlang的构建工具,请通过https://github.com/rebar/rebar/wiki/Rebar-commands对于命令。 获得依赖后,需要“rebarcompile”来编译。 要使用光束文件,您必须使用Add Path to Erlang Search Path?给出输出光束路径。 这些方法。 然后您就可以在代码中使用它。
关于mysql - 如何在 Erlang 中安装驱动程序? (特别是 MySQL-otp 驱动程序),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53699488/