MySQL DB access via shell.
- February 2nd, 2018
- Posted in Documentation
- Write comment
Here is a decent secure way to get yourself access to your MySQL/MariaDB databases from a shell script in linux:
# umask 277
# vi /somedirectory/.supersecretfile
# ls -l /somedirectory/.supersecretfile
-r——–. 1 root root 36 Feb 2 11:58 /somedirectory/.supersecretfile
# umask 022
# mysql –defaults-file=/somedirectory/.supersecretfile -e “SOME SQL COMMAND”
No comments yet.