MySQL query 'select t.id offer_id from (select oi.id, c.offer_id coi, min(c.city_id) cci_min, min(left(c.dt, 10)) dtg_min, max(left(c.dt, 10)) dtg_max, count(distinct left(c.dt, 10)) dtg_cn, count(c.id) ci_cn, round(sum(oo.pay_price)) op_sum, round(sum(oo.pay_price)/count(distinct left(c.dt, 10))) pd from vgnew.coupon c, vgnew.offeropt oo, mk.offer_import oi, mk.offer o, mk.offerlist_76_1 l where o.id = l.id and o.alg_moderated > 0 and o.id = oi.id and oi.import_id = c.offer_id and oo.id = c.offeropt_id and oo.pay_price > 0 group by coi order by dtg_max desc, cci_min asc, pd desc limit 200) t' failed: SELECT command denied to user 'mk'@'127.0.0.1' for table 'coupon'