Template - API
WelcomePrerequisitesNodeJS
  • Welcome!
    • About me
  • Prerequisites
    • Installation and Database Setup
    • Installing Node.js on the Server
  • NodeJS
    • 🆓Getting Started with the Free Template
    • 🎗️Premium Template - REST API
      • Structure
      • Middlewares and Guards
      • Core Modules
        • Prisma with NestJS
        • Swagger with NestJS
      • Dynamic Module
        • Create or Import Module
  • Modules
    • 🎗️Websockets
    • 🎗️Mailer
    • 🎗️Upload
Powered by GitBook
On this page
  1. Prerequisites

Installation and Database Setup

MYSQL


To get started, you'll need to install MySQL and create a new database for the API. Here's how you can do it on your Linux server:

Install Mysql

sudo apt update
sudo apt install mysql-server

Secure MySQL Installation

After installation, it's important to run the following command to secure your MySQL instance:

sudo mysql_secure_installation

Create a Database

Once MySQL is installed and running, you'll need to create a database for the API

sudo mysql -u root -p
CREATE DATABASE mydatabase;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON mydatabase.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

Replace mydatabase, username, and password with the appropriate values for your setup.

Exit MySQL

EXIT;
PreviousPrerequisitesNextInstalling Node.js on the Server

Last updated 9 months ago