jamesrwhite / minicron

🕰️ Monitor your cron jobs
GNU General Public License v3.0
2.34k stars 154 forks source link

Wrong db host connection #233

Closed Rido closed 7 years ago

Rido commented 8 years ago

The last time I got some problems with the database connections. For some reason Minicron is using the wrong database host.

Error message: Mysql2::Error: SELECT command denied to user 'minicron'@'mailtester.xxxxx.lan' for table 'executions': SELECTexecutions.* FROMexecutionsORDER BYexecutions.created_atDESC,executions.started_atDESC LIMIT 1

My config is:

host = "127.0.0.1"
port = 9292
path = "/"
pid_file = "/tmp/minicron.pid"
timezone = "Europe/Amsterdam"
  [server.session]
  name = "minicron.session"
  domain = "127.0.0.1"
  path = "/"
  ttl = 86400
  secret = "xxxxx"
  [server.database]
  type = "mysql" # [mysql, postgresql, sqlite]
  # The options below are for mysql and postgresql only
  host = "192.168.12.234"
  database = "minicron"
  username = "minicron"
  password = "xxxxx"
  [server.ssh]
  connect_timeout = 5

Is there a fix for this problem or am I doing something wrong?

Thanks!

jamesrwhite commented 8 years ago

Have you restarted minicron since you changed the configuration? It opens a connection once at startup and will not re-connect if the config changes.

Rido commented 8 years ago

Yes, I restarted Minicron several times, but each time I get this error.

eduardogalbiati commented 7 years ago

It seems like the user 'minicron' on mysql server does not have permission to read (perform a SELECT) on database, did u checked this permissions on mysqlserver?

jamesrwhite commented 7 years ago

I think this is more likely to be a permissions issue in MySQL than minicron itself as mentioned above so I'm closing this.