How to connect MySQL in your backend project (NestJS + Prisma)

Hi, I thought about this problem because on the internet I couldn't find information on how to correctly connect MySQL in a basic backend project. Also, I'll show you how to use it in a monorepo project. In this lesson, we'll be using NestJS and Prisma, as they are the most popular tools in backend development.
Okay, now, create a folder wherever you're comfortable, and open the terminal. In the terminal, type these commands:
$ npm i -g @nestjs/cli
$ nest new project-name
$ cd project-name
The next steps — you can start building anything with your project. But when you need a database, you'll need to import Prisma into your project. It's easy — run this command:
$ npm install prisma --save-dev
As a best practice, it's recommended to invoke the CLI locally by prefixing it with npx:
$ npx prisma
$ npx prisma init
Nice! Now, the following files should appear in your project:

















