July 2017
Intermediate to advanced
656 pages
16h 1m
English
The createConnection method establishes a connection to the server and returns a db instance for us to interact with.
We can pass in an options object that may contain an assortment of various properties. We have included password and debug properties, though they are commented out as they're not needed in the common case.
If we uncomment debug, we can see the raw data being sent to and from the server. We only need to uncomment password if our MySQL server has a password set.
The db.query call sends SQL to the MySQL server, which is then executed.
When executed, the SQL creates a database ...