Once you've run through all of the steps for designing and finalizing a database (a surprising amount of work), it's time to actually create the database within MySQL. To create both the database and the tables, you'll use the mysql client and some basic SQL.
In Chapter 2, "Running MySQL," I quickly defined two databases to help demonstrate how to add users. As you may recall, the syntax for creating a new database is CREATE DATABASE dbname
To specify a character set or collation for the entire database, add another clause to the end of the CREATE query:
CREATE DATABASE dbname CHARACTER SET setname COLLATE collationname
To demonstrate the CREATE statement, I'll establish the accounting database.
To create a database: