Skip to content
  • SiteMap
  • Our Services
  • Frequently Asked Questions (FAQ)
  • Support
  • About Us

UpdateGadh

Update Your Skills.

  • Home
  • Projects
    •  Blockchain projects
    • Python Project
    • Data Science
    •  Ai projects
    • Machine Learning
    • PHP Project
    • React Projects
    • Java Project
    • SpringBoot
    • JSP Projects
    • Java Script Projects
    • Code Snippet
    • Free Projects
  • Tutorials
    • Ai
    • Machine Learning
    • Advance Python
    • Advance SQL
    • DBMS Tutorial
    • Data Analyst
    • Deep Learning Tutorial
    • Data Science
    • Nodejs Tutorial
  • Blog
  • Contact us
  • Toggle search form
Node.js MySQL Create Database

Node.js MySQL Create Database

Posted on October 18, 2025October 18, 2025 By Rishabh saini No Comments on Node.js MySQL Create Database

Node.js MySQL Create Database

The CREATE DATABASE statement in MySQL is used to create a new database. In this tutorial, we’ll learn how to create a MySQL database using Node.js.

Data Science Tutorial:–Click Here

Example

Let’s create a database named “updategadh” using Node.js.

First, create a JavaScript file named updategadh.js inside a folder named DBexample and add the following code:

var mysql = require('mysql');  
var con = mysql.createConnection({  
  host: "localhost",  
  user: "root",  
  password: "12345"  
});  

con.connect(function(err) {  
  if (err) throw err;  
  console.log("Connected!");  
  con.query("CREATE DATABASE updategadh", function (err, result) {  
    if (err) throw err;  
    console.log("Database created");  
  });  
});  

Running the Script

Introduction to Applied AI:–Click Here

Open your terminal, navigate to the DBexample folder, and run the following command:

node updategadh.js

If the connection and query execute successfully, you’ll see the following messages in your terminal:

Connected!  
Database created

This means your updategadh database has been successfully created.

Download New Real Time Projects :–Click here

Verification

To confirm that the database has been created, open your MySQL command prompt and use the following command:

SHOW DATABASES;

You’ll see updategadh listed among the available databases, indicating that your new database was created successfully.

Machine Learning Tutorial:–Click Here
Complete Advance AI topics:- CLICK HERE
Deep Learning Tutorial:– Click Here
Complete Python Course with Advance topics:-Click Here
SQL Tutorial :–Click Here


node js mysql create database example node js mysql create database w3schools avascript mysql database connection example node js mysql query return result connect mysql with node js express database connection in node js with mongodb node js mysql connection node js database connection mysql create database javascript, nodejs mysql database tutorial, sequelize mysql database with nodejs, nodejs + expressjs + mysql database connection, nodejs + mysql database connection tutorial, mysq; database connection with nodejs, how to connect mysql database in node.js, how to connect to mysql database from node.js, nodejs mysql crud, mysql database, relational database nodejs, mysql database connection in node js, nodejs mysql, databasing with mysql and nodejs, learn nodejs databases, nodejs mysql2

    Post Views: 247
    Node.js Tutorial Tags:databasing with mysql and nodejs, how to connect mysql database in node.js, how to connect to mysql database from node.js, learn nodejs databases, mysq; database connection with nodejs, mysql create database javascript, MySQL Database, mysql database connection in node js, nodejs + expressjs + mysql database connection, nodejs + mysql database connection tutorial, nodejs mysql, nodejs mysql crud, nodejs mysql database tutorial, nodejs mysql2, relational database nodejs, sequelize mysql database with nodejs

    Post navigation

    Previous Post: Best Contact Management System Using Node.js, Express, MongoDB
    Next Post: Best Web-Based Online Voting System Using PHP & MYSQL

    More Related Articles

    Node.js MySQL Insert Records Node.js MySQL Insert Records Node.js Tutorial
    Node.js DNS module Node.js DNS module Node.js Tutorial
    Node.js vs AngularJS Node.js vs AngularJS – Full Stack Web Project Node.js Tutorial

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    You may also like

    1. Install Nodejs on Windows
    2. Node.js Command Line Options
    3. Node.js Assertion Testing
    4. Node.js MySQL Delete Records
    5. Node.js Create Connection with MongoDB
    6. Node.js MongoDB Filter Query

    Most Viewed Posts

    1. Top Large Language Models in 2025
    2. Online Shopping System using PHP, MySQL with Free Source Code
    3. login form in php and mysql , Step-by-Step with Free Source Code
    4. Flipkart Clone using PHP And MYSQL Free Source Code
    5. News Portal Project in PHP and MySql Free Source Code
    6. User Login & Registration System Using PHP and MySQL Free Code
    7. Top 10 Final Year Project Ideas in Python
    8. Online Bike Rental Management System Using PHP and MySQL
    9. E learning Website in php with Free source code
    10. E-Commerce Website Project in Java Servlets (JSP)
    • AI
    • ASP.NET
    • Blockchain
    • ChatCPT
    • code Snippets
    • Collage Projects
    • Data Science Project
    • Data Science Tutorial
    • DBMS Tutorial
    • Deep Learning Tutorial
    • Final Year Projects
    • Free Projects
    • How to
    • html
    • Interview Question
    • Java Notes
    • Java Project
    • Java Script Notes
    • JAVASCRIPT
    • Javascript Project
    • JSP JAVA(J2EE)
    • Machine Learning Project
    • Machine Learning Tutorial
    • MySQL Tutorial
    • Node.js Tutorial
    • PHP Project
    • Portfolio
    • Python
    • Python Interview Question
    • Python Projects
    • PythonFreeProject
    • React Free Project
    • React Projects
    • Spring boot
    • SQL Tutorial
    • TOP 10
    • Uncategorized
    • Online Examination System in PHP with Source Code
    • AI Chatbot for College and Hospital
    • Job Portal Web Application in PHP MySQL
    • Online Tutorial Portal Site in PHP MySQL — Full Project with Source Code
    • Online Job Portal System in JSP Servlet MySQL

    Most Viewed Posts

    • Top Large Language Models in 2025 (8,615)
    • Online Shopping System using PHP, MySQL with Free Source Code (5,218)
    • login form in php and mysql , Step-by-Step with Free Source Code (4,872)

    Copyright © 2026 UpdateGadh.

    Powered by PressBook Green WordPress theme