This related question asks about using a parameterized query when using the commandline mysql
tool in bash. However, it seems that the top answer is still vulnerable to injection (eg ; DROP TABLE user; --
). While the answer certainly does address the question of how to pass in variables at all, it does not address the question of how to do it using parameterized queries.
My question: Does the linked accepted answer in the linked question provide protection against SQL injection, and have all the useful protections of paramterization? If so, why? If not, how can I securely use a parameterized query from the MySQL command line tool?
Note: Technically I am running mysql Ver 15.1 Distrib 10.3.13-MariaDB
.