Our company has recently started using Magento and we were told we could run SQL queries from the admin panel. I am familiar with MySQL, SQL queries but am NOT a Magento guru and therefore have no idea where to start. First of all, is it possible to run a SQL query from the admin panel in Magento? Second of all, where and how to i run a query from the admin panel? It would be nice if someone could provide me with an ELI5 (explain like i'm 5) answer.

Hope my question makes sense, english isn't my primary language. Hope someone can help us out!

  • Magento default not provide for run directly query from admin panel.
    – user15917
    Commented May 20, 2016 at 11:12

1 Answer 1


By default there is no way to run mysql queries from the magento admin.
And there shouldn't be.
This would be a high security risk.
Not all people that have access to the admin are technical people and they can easily screw something up.
And even if only technical people had access to the admin panel they can still screw up something just as easily.
On an other topic, you should never run sql queries on magento db (I admit, I did it, but I shouldn't have).
The database schema is complex (read "crazy") and you can easily commit something.
If you really insist in running direct queries you can install a phpmyadmin on the server, but just note it, I do not condone this kind of behavior.

  • So you're telling me there's absolutely no way to run a query in a magento database? I need to gather data on a product that has been sold by a certain person to calculate the commission he will receive, any idea how i can make that happen? Commented May 20, 2016 at 13:01
  • @JurgenvanDelft. There are ways to run queries on the db, but not built in. You can build a module that allows you this, but I don't recommend it. For different reports you can also build a module using internal collection and objects, but that's a totally different question. Please ask an other one explaining what you need.
    – Marius
    Commented May 20, 2016 at 13:51
  • Maybe you can just allow only SELECT queries. You can develop custom module similar to this (which is for Magento 1) - github.com/kalenjordan/custom-reports
    – MagePsycho
    Commented May 20, 2016 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.