How to create a database from shell command?
You mean while the mysql environment?
create database testdb;
Or directly from command line:
mysql -u root -e "create database testdb";
cat filename.sql | mysql -u username -p # type mysql password when asked for it
Where filename.sql holds all the sql to create your database. Or...
echo "create database `database-name`" | mysql -u username -p
If you really only want to create a database.