Database IntegrationLesson 48Free preview
MySQL Create Database
This lesson is part of Node.js · All levels
Summary
Before storing data, a database must be created first, either through mysql CLI or from a Node script. Once the database is available, the next step is to select it as the default connection. A neat database structure makes applications easier to maintain and scale.
Key points
- CREATE DATABASE name_db is creating a new database
- Use IF NOT EXIST to avoid errors when there are already
- Once it's created, include the database field when making the connection.
- The database can be created using mysql CLI or a Node script with mysql2
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.