X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmathql_interpreter%2FmQIMySql.ml;h=4a68c93987a1c856af9c237ae938e20a7a76a3ed;hb=5325734bc2e4927ed7ec146e35a6f0f2b49f50c1;hp=e5cb01e4641f7489cabb48842a00062f11ea748c;hpb=52f0f77f24e6a1dfd2a1b277d6ade218039ba574;p=helm.git diff --git a/helm/ocaml/mathql_interpreter/mQIMySql.ml b/helm/ocaml/mathql_interpreter/mQIMySql.ml index e5cb01e46..4a68c9398 100644 --- a/helm/ocaml/mathql_interpreter/mQIMySql.ml +++ b/helm/ocaml/mathql_interpreter/mQIMySql.ml @@ -27,8 +27,18 @@ *) let init () = - try Mysql.quick_connect - ~host:"mowgli.cs.unibo.it" ~database:"mowgli" ~user:"helm" () + let module HR = Helm_registry in + let host = + HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.host" in + let database = + HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.database" in + let user = + HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.user" in + let port = + HR.get_opt HR.get_int "mathql_interpreter.mysql_connection.port" in + let password = + HR.get_opt HR.get_string "mathql_interpreter.mysql_connection.password" in + try Mysql.quick_connect ?host ?database ?user ?port ?password () with _ -> raise (Failure "mqi_connecion") let close c = Mysql.disconnect c