Mysql execute command from bash code example
Example 1: mysql execute command from command line
mysql -u <user> -p -e "select * from schema.table"
Example 2: run mysql command from bash
mysql --user="$user" --password="$password" --database="$database" --execute="DROP DATABASE $user; CREATE DATABASE $database;"
Example 3: mysql bash execute sql file
mysql -u user -p data_base_name < sql_file.sql
# execute sql file in target database or juste in mysql