r/mysql • u/Tiny-Yesterday4164 • Sep 06 '24
question Is using GUI client to connect production database safe?
Hi all,
The developers in my team suggest that don't use Mysql GUI clients like `dbeaver` to connect to the production database.
One of the arguments are -
"Some bad read only sql queries can lock database tables. So potentially that could also impact production environment."
is this true?
Instead, the suggestion was,
we can connect to the non-production databases using the GUI client and prepare a SQL query. Then run it using MySql CLI in a bastion server(so it is traceable).
so, what is the best way to access the production database?
7
u/tyrrminal Sep 06 '24
From a technical perspective, it's no different, but the points here are relevant in the real world. Giving access to the prod DB via GUI clients encourages (or at least fails to discourage) writing malformed or un-performant queries in try-fail-repeat cycles.
By restricting access to just the mysql CLI, of course you can still break the rules and write whatever you want and pipe it into mysql, but you're more likely to follow the rules and only fire off dev-tested queries this way.
2
u/dsn0wman Sep 06 '24