mysql client is powerful with its shell like console.what about to create database or mysql user from command line option if you don’t want to log into mysql console.the mysql -e option can help with this.To create database , we can issue the following command:
mysql -u mysql_user -p mysql_pass -e “CREATE DATABASE db1;”
To create mysql user from command line option -e:
mysql -u mysql_user -p mysql_pass -e “GRANT ALL PRIVILEGES ON db1.* TO ‘db1_user’@'localhost’ IDENTIFIED BY ‘db1_pass’;”
with the help of -e option,we can batch create database and mysql user in our script.i think that’s why mysql client program support this option.