theo09
Ecto create a repo error
I wish to use Ecto for a project but when I realize the command mix ecto.create I have the following error Invalid Elixir version requirement in mix.exs file. However, I have the same version in this file as that at present used. I tried with of other one versions but the error is always present. Can you help me?
Most Liked
garthk
config :my_app, MyApp.Repo,
# Help diagnose connection errors:
show_sensitive_data_on_connection_error: true
NobbZ
Usually asdf is installed “per user”, so I assume that root won’t even see the asdf script/function (however its implemented).
NobbZ
Oh, and you will probably need to sudo rm -rf _build deps before using mix without sudo again to “repair” ownerships and permissions.
kokolegorille
You should check your credentials. It is located in the config folder of your farmbot application.
You should match that the user specified is allowed to use database.
In case not… You might look at https://www.postgresql.org/docs/9.5/static/sql-createuser.html
Aetherus
I’m using ecto with mariadb (Mariaex) in a non-Phoenix app. This is my database config:
# config/config.exs
config :iocp_monitor, ecto_repos: [IocpMonitor.Repo]
config :iocp_monitor, IocpMonitor.Repo,
database: "iocp",
username: "root",
password: "1q2w3e4r5t",
hostname: "localhost",
port: "3306",
migration_timestamps: [type: :utc_datetime]
And this is my repo definition:
defmodule IocpMonitor.Repo do
use Ecto.Repo,
otp_app: :iocp_monitor,
adapter: Ecto.Adapters.MySQL
end
When I run mix ecto.create and mix ecto.migrate, they finished successfully, and I can see the new database and the new tables in it, so I suppose the database connection configuration is correct. But when I try to start my otp app, this happens:
13:22:08.399 [error] GenServer #PID<0.421.0> terminating
** (RuntimeError) connect raised ArgumentError exception.The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true if you wish to see all of the details
:erlang.byte_size/1
(mariaex) lib/mariaex/messages.ex:103: Mariaex.Messages.encode_handshake_resp/1
(mariaex) lib/mariaex/messages.ex:219: Mariaex.Messages.encode/2
(mariaex) lib/mariaex/protocol.ex:1156: Mariaex.Protocol.msg_send/3
(mariaex) lib/mariaex/protocol.ex:218: Mariaex.Protocol.handle_handshake/3
(mariaex) lib/mariaex/protocol.ex:171: Mariaex.Protocol.handshake_recv/2
(db_connection) lib/db_connection/connection.ex:66: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
Last message: nil
State: Mariaex.Protocol
I have no idea why it fails, and I don’t know where to add the configuration :show_sensitive_data_on_connection_error. Can anyone help? Thanks in advance.







