I’m trying to connect a Phoenix (1.5) app to a Managed Digital Ocean MySQL Database but I’m receiving the following error when I try to boot up my application
[error] GenServer #PID<0.625.0> terminating ** (RuntimeError) Connect raised a FunctionClauseError error. The exception details are hidden, as they may contain sensitive data such as database credentials. (mariaex 0.8.4) lib/mariaex/protocol.ex:1006: Mariaex.Protocol.password/3 (mariaex 0.8.4) lib/mariaex/protocol.ex:207: Mariaex.Protocol.handle_handshake/3 (mariaex 0.8.4) lib/mariaex/protocol.ex:166: Mariaex.Protocol.handshake_recv/2 (db_connection 1.1.3) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2 (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5 (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3 Last message: nil State: Mariaex.Protocol [error] GenServer #PID<0.611.0> terminating
Things of note:
- The version of Mariaex I’m using is 0.8.4
- I am able to connect to the database from the server
- I have a Laravel application on the same server which connects to the database ok
- I’m using a MySQL user with Legacy – MySQL 5.x password encryption
I have tried setting
DATABASE_URL="mysql://<USER>:<PASSWORD>@<PRIVATE_HOSTNAME>:25060/<DB_NAME> as well as using this in my prod.secret.exs
config :appname, Appname.Repo, adapter: Ecto.Adapters.MySQL, username: "<USERNAME>", password: "<PASSWORD>", database: "<DB_NAME>", hostname: "<PRIVATE_HOSTNAME>", port: 25060, pool_size: 15, ssl: true, show_sensitive_data_on_connection_error: true
I have the same set up working on a staging server with the one difference being that the MySQL database is on the same server.
I get this error both from firing up
mix phx.server and from using mix release. Even when I try with the environment set to dev I’m unable to see more detailed logs.
I feel like I’ve hit a brick wall with this. Has anyone ran into anything like this before? Any advice for if I’ve missed something?