开发者

How can I connect to my database using erlang-mysql-driver?

开发者 https://www.devze.com 2023-03-23 12:43 出处:网络
I am attempting to use e开发者_如何转开发rlang-mysql-driver to connect to my MySQL database but am not having any luck.

I am attempting to use e开发者_如何转开发rlang-mysql-driver to connect to my MySQL database but am not having any luck.

I am using the following Erlang code to connect

mysql:start_link(p1,"localhost","myname","mypass","stocks").

The error message I get is:

mysql_recv:108: mysql_recv: Failed connecting to "localhost":3306 : {error,
                                                                 econnrefused}
mysql_conn:361: failed connecting to "localhost":3306 : {error,
                                                     "connect failed : {error,econnrefused}"}
mysql:511: failed starting first MySQL connection handler, exiting
** exception exit: {badfun,undefined}
 in function  mysql:start_reconnect/2
 in call from mysql:init/1
 in call from gen_server:init_it/6
 in call from proc_lib:init_p_do_apply/3

Any ideas?


I'm using this driver (https://github.com/Eonblast/Emysql) and do all as in docs - and all works fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消