Here are some frequently used mysql commands for quick reference.
mysql -u root -p <enter>
mysql -u root -p'yourpassword'
CREATE USER 'user'@'localhost' IDENTIFIED BY 'your_password';
CREATE database INVERNTORY;
GRANT ALL PRIVILEGES ON inventory.* TO 'community'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
# import database
mysql -u username -p password [databasename] < [sql file name]
# export database
mysqldump -u username -p'password' [databasename] > [sql file name]
# copy or clone a database
mysqldump -u <user name> -p'yourpassword' <original_db> | mysql -u <user name> -p'yourpassword' <new db>