Creating database and adding user using CLI
For Creating a MySQL database and adding a user from CLI go through the following: Go to the mysql prompt and run the following commands:
mysql -uroot -p mysql> CREATE DATABASE dbname;
mysql> GRANT ALL PRIVILEGES ON dbname.* TO user@localhost IDENTIFIED BY ‘password-goes-here’ WITH GRANT OPTION;
Where dbname will be replace with database name and user will with username which need to add.