I want to script the creation of a database on CentOS7. I know how to run the commands but what would I need to turn this into a script?
mysql -u root -p
create database db;
create user 'user'@'localhost' identified by 'password';
grant all on db.* to 'user'@'localhost';
flush privileges;
quit