Tutorial : How to create MySQL Database and Table in Command Prompt

in #utopian-io7 years ago (edited)

What Will I Learn?

  • How to create MySQL Database
  • How to create MySQL Table

Requirements

  • Xampp
  • PC (Windows )

Difficulty

  • Basic

Tutorial Contents

What is MySQL ?

MySQL is a database software relation (Relational Database Management System or RDBMS), as well as ORACLE, Postgresql, MS SQL, and so on. MySQL was developed around 1994 by a software development company and database consultant named MYSQL AB residing in Sweden.

Now just go to the tutorial, follow the steps below:

  • The first step should you do open the xampp mysql to enable application press start on mysql to activate it follow like below.

image

  • After that you guys open command prompt click start in windows after that you guys search for cmd

image

  • After opening the cmd to get out like the picture below

image

  • Before we get to the tutorial how to create a database we go first to the mysql server please follow as below.

  • Type cd \ this command is used to switch to directetori C

image

  • Next you guys type commandcd xampp like below and press enter

image

  • Next type command cd mysql and press enter

image

  • After typing the command cd mysqlnext you guys type cd bin and press enter

image

  • Now you guys type the commands mysql – u root to get into your mysql server and press enter to exit as below, once it comes out like the picture below means you guys managed to get the mysql server

image

  • Next you guys type the command create database dbardifitra;then press enter, so it comes out like the picture below

image

  • After we make the data base we now see databases that we have created earlier with the way type the command show databases;then press enter

image

  • After successfully creating a database we will now create a table, before we make our table select the first database that would like to use to create the chart, an example I will now select the database dbardifitra, how to select a command type use dbardifitra; see the image as shown below

image

  • After the above command to select the database that you want to use it we will make the table, to make the chart type commandcreate table tbardifitra ( NIK int not null, Name char(20), Place char(50) ) like the image below and then press enter

image

  • To see the structure of the table that we've created last type the command desc tbardifitra; then press enter look like the image below

image

  • To see a table who've we created last type the command show tables; then press enter look like the picture below

image

Here's my tutorial, hopefully useful



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it is a duplicate. It is very similar to a contribution that was already accepted here & here.

You can contact us on Discord.
[utopian-moderator]