https://github.com/michdo93/nodejs-mysql
A simple CRUD MVC example with nodejs, express, ejs and mysql
https://github.com/michdo93/nodejs-mysql
Last synced: about 1 month ago
JSON representation
A simple CRUD MVC example with nodejs, express, ejs and mysql
- Host: GitHub
- URL: https://github.com/michdo93/nodejs-mysql
- Owner: Michdo93
- Created: 2021-02-04T19:13:29.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-04T19:26:06.000Z (over 5 years ago)
- Last Synced: 2025-12-01T21:38:06.124Z (8 months ago)
- Language: CSS
- Size: 977 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nodejs-mysql
## Installation
```
git clone https://github.com/Michdo93/nodejs-mysql.git
cd nodejs-mysql
npm install
```
## Create the Database
Insert following code as SQL statement or import customers.sql inside the database `testdb`
```
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5ubuntu0.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 04, 2021 at 08:23 PM
-- Server version: 5.7.32-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `testdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `customers`
--
CREATE TABLE `customers` (
`id` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`active` tinyint(1) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `customers`
--
INSERT INTO `customers` (`id`, `email`, `name`, `active`) VALUES
(1, 'test@gmail.com', 'test', 1),
(2, 'dump@hs-furtwangen.de', 'dump', 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
```