Program to create a database with Mysql.

Here, we have a basic program example to create database using Mysql in Python and Java.

Code to create database in Python language

import mysql.connector
con=mysql.connector.connect(host="localhost", user="root", passwd="root")
cur.execute("create database coder")

Code to create database in Java language

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class CreateDB {
   public static void main(String[] args) {
      Connection con=null;
      Statement stmt=null;
      String yourDatabaseName="Customer_Tracker_Database";
      try {
         stmt = con.createStatement();
         int status = stmt.executeUpdate("CREATE DATABASE : "+yourDatabaseName);
         if(status > 0) {
            System.out.println("Database is created successfully !!!");
      catch(Exception e) {