I\'m creating a bash script which, among other things, gathers some data from a MySQL database. My MySQL user has write privileges, but for safety reasons I would like to te
If you're using MySQL 5.6 or newer and InnoDB, you can make a session read-only.
SET SESSION TRANSACTION READ ONLY;
https://dev.mysql.com/doc/refman/5.6/en/set-transaction.html
"READ ONLY" also offers a modest performance benefit.