In every project you work on, you should consider building a database description file, named "db.sql". This file is a text file where you add your users, design your tables, add your default data, and everything else that you might want to keep track of.
It's also a good idea to document relationships between your tables in this file.
From there, you can copy and paste your text into your MySQL terminal. This makes it easy to work on multi-line database queries.
It's customary to create a db folder under your project root to store db.sql.
For example:
You can also use your db.sql file to install a db.sql file on a remote server or on another users machine:
$ mysql -u root -p < db.sql
What happens is, the db.sql file gets piped into mysql. MySQL interprets it as you typing the commands yourself. It doesn't know the difference, honestly. It's just dumb enough not to care...