Can't connect using a non-root user

Where in my code would I place this code?
MyXQL.start_link([...])

Never mind - found it in the hexdocs.

I posted it in a previous comment in this thread (the third one from the top)

Sorry, had only seen the dev.exs on first read. So since you start in prod, changes in dev.exs have no effect at all. Also you haven’t any repo settings in the prod.exs. though you figured out in the meantime how to deal with your current environment.

You should not. This was just a test to see if MyXQL can connect to MySQL with the correct user. And because you are able to connect and run that query we can now rule out any problems with MyXQL and MySQL setup. Then we just need to move to the next layer in the stack to see if that still works.

The start_link code will be started from the OTP supervisors and be under a supervision tree, but when trouble-shooting it is important to be able to rule out as much as possible to narrow down the search for the real problem.

MyXQL.start_link will likely be called by ecto because MyXQL is an adapter to ecto.

OMG! You are going to shoot me!!!

I was about to place the start MyXQL under my application’s supervision tree and I found this:

  use Application

  def start(_type, _args) do
    # List all child processes to be supervised
    children = [
      {MyXQL, username: "root", name: :myxql},
      ...

I totally beg your forgiveness and thank you again for all your help!

8 Likes

Classic! (we’ve all been there)

1 Like