Concept Flow - MySQL connection with mysql2
Import mysql2 module
Create connection config
Call mysql.createConnection()
Connect to MySQL server
Check for connection error
Handle error
Use connection for queries
Close connection when done
This flow shows how to import mysql2, create a connection, handle errors, and use the connection for queries.