Skip to content

codrkai/node_react_mysql_db_tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Using MySQL with Node and React JS

This tutorial uses the same project files from node_react_mongodb_tutorial, and modified to use with MySQL database instead of MongoDB.

First, install MYSQL using homebrew

For my case since I'm running MacOS Mojave on my Macbook Pro, I'm going to install MySQL version 5.7

brew install mysql@5.7

I need to force my MacOS to use MySQL version 5.7

brew link --force mysql@5.7

(optional) Set up a database password if you would like...

mysql_secure_installation

Start up the MySQL server

brew services start mysql@5.7

Other useful commands:

brew services restart mysql@5.7
brew services list
brew services cleanup

Install MySQL as a package dependency inside of the backend folder

cd backend
npm install mysql

Install MySQL Workbench

For my MacOS Mojave, I installed Workbench version 8.0.18

MySQL Workbench:

  • Create a Connection
  • Create a new Schema (node_twitterclone)
  • Create tables (users, tweets)

About

How to use MySQL with Node and React JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published