How To Create a Database Using CMD In MySQL Localhost

How to create a database using cmd in MySQL Localhost is a simple guide to create database in command line prompt. You can follow these steps to create database in Linux or mac using Linux shell or command line utility based on operating system. If you are using windows install WAMP server, xampp server or else you can install those individually. After installing follow this procedure.

Steps to create a database using cmd in MySQL Localhost

  1. Login to MySQL Database using command line prompt or shell .
  2. Next create MySQL Database in command line utility.
  3. Use the Database for creating tables.

1. Login to MySQL Database using command line prompt or shell

  1. If you are using WAMP, Open MySQL Console from System Tray icon.
    MySQL Console WAMP System tray icon

    MySQL Console WAMP System tray icon

  2. Or else open Command line utility or Shell, and use below command.
    mysql -u your-database-username -p your-database-password

    • your-database-username : this is the user name of your database
    • your-database-password : this is the password of your database
  3. After connecting to database, you can proceed with next step.

2. Create MySQL Database

  • For creating database form command line prompt or shell, Use the below command.
    CREATE DATABASE nameofyourdatabase;
  • CREATE DATABASE is the command, and next one is your database name.
  • And at the end of statement semicolon is must.
    Create Database Use DataBase MySQL WAMP

    Create Database Use DataBase MySQL WAMP

3. Use the Database for creating tables

After creating the database, next step is creating table.

  1. For creating table, first you need to access the table or in common words you need to select the database.
  2. For selecting database command is
    USE nameofyourdatabase;
  3. Then you can continue with creating tables in that database.

If you want to view all the databases, then use this simple command to list all the databases. SHOW DATABASES; This command will lists all the databases.

Incoming search terms:

  • cmd locahost
  • create database in cmd using wamp server
  • design a database using wampserver console
  • how to create a database using php wamp console
  • how to create database of wamp in cmd
  • how to create table in database mysql wamp console
  • what is the next after creating a database in wamp
Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply:

x

Join My Facebook Group to Receive Coding Tutorial for Free

email-subsribe