0% found this document useful (0 votes)
10 views

Command Prompt - mysql -u root -p

Uploaded by

Rafat Ullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Command Prompt - mysql -u root -p

Uploaded by

Rafat Ullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Microsoft Windows [Version 10.0.22631.

4460]
(c) Microsoft Corporation. All rights reserved.

C:\Users\RAFAT>sqlcmd
'sqlcmd' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\RAFAT>mysql -u root -[
mysql: [ERROR] mysql: unknown option '-['.

C:\Users\RAFAT>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 8.0.40 MySQL Community Server - GPL

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its


affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database rafat;


Query OK, 1 row affected (0.01 sec)

mysql> use rafat;


Database changed
mysql> create database booksdetail;
Query OK, 1 row affected (0.01 sec)

mysql> use booksdetail;


Database changed
mysql> use rafat;
Database changed
mysql> create table bookdetails
-> (bookno int(2)primary key,
-> bookname varchar(25),
-> price int(4),
-> publisher varchar(25),
-> dateofpublition date);
Query OK, 0 rows affected, 2 warnings (0.03 sec)

mysql> desc bookdetails;


+-----------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+---------+-------+
| bookno | int | NO | PRI | NULL | |
| bookname | varchar(25) | YES | | NULL | |
| price | int | YES | | NULL | |
| publisher | varchar(25) | YES | | NULL | |
| dateofpublition | date | YES | | NULL | |
+-----------------+-------------+------+-----+---------+-------+
5 rows in set (0.01 sec)

mysql> insert into bookdetails values(1,"MAHABHARAT",500,"ZAHID",'2020-10-1');


Query OK, 1 row affected (0.01 sec)
mysql> insert into bookdetails values(2,"RAMAYAN",800,"MAHID",'2019-11-11');
Query OK, 1 row affected (0.00 sec)

mysql> insert into bookdetails values(3,"LE PERE GARIOT",100,"HONORE DE


BELZAC",'1835-11-11');
Query OK, 1 row affected (0.00 sec)

mysql> insert into bookdetails values(4,"DAVID COPPERFIELD",1100,"CHARLES


DICKENS",'1849-12-11');
Query OK, 1 row affected (0.01 sec)

mysql> insert into bookdetails values(5,"WAR AND PEACE",1500,"TOLSTOY",'1869-09-


08');
Query OK, 1 row affected (0.00 sec)

mysql> insert into bookdetails values(6,"HULULU",1100,"BOWMAN",'1870-09-08');


Query OK, 1 row affected (0.00 sec)

mysql> insert into bookdetails values(7,"LALLAA",1170,"SHAKTIMAN",'1876-01-08');


Query OK, 1 row affected (0.01 sec)

mysql> insert into bookdetails values(8,"KOHRE KOHRE SAPNE",1220,"BHANU PRATAP


SINGH",'1896-01-02');
Query OK, 1 row affected (0.01 sec)

mysql> insert into bookdetails values(9,"SIGMA",2230,"THOMAS SHELBY",'1796-07-05');


Query OK, 1 row affected (0.01 sec)

mysql> insert into bookdetails values(10,"SITUATIONSHIP",2110,"SAMAY",'1996-02-


01');
Query OK, 1 row affected (0.00 sec)

mysql> desc bookdetails;


+-----------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+---------+-------+
| bookno | int | NO | PRI | NULL | |
| bookname | varchar(25) | YES | | NULL | |
| price | int | YES | | NULL | |
| publisher | varchar(25) | YES | | NULL | |
| dateofpublition | date | YES | | NULL | |
+-----------------+-------------+------+-----+---------+-------+
5 rows in set (0.00 sec)

mysql> select* from bookdetails;


+--------+-------------------+-------+--------------------+-----------------+
| bookno | bookname | price | publisher | dateofpublition |
+--------+-------------------+-------+--------------------+-----------------+
| 1 | MAHABHARAT | 500 | ZAHID | 2020-10-01 |
| 2 | RAMAYAN | 800 | MAHID | 2019-11-11 |
| 3 | LE PERE GARIOT | 100 | HONORE DE BELZAC | 1835-11-11 |
| 4 | DAVID COPPERFIELD | 1100 | CHARLES DICKENS | 1849-12-11 |
| 5 | WAR AND PEACE | 1500 | TOLSTOY | 1869-09-08 |
| 6 | HULULU | 1100 | BOWMAN | 1870-09-08 |
| 7 | LALLAA | 1170 | SHAKTIMAN | 1876-01-08 |
| 8 | KOHRE KOHRE SAPNE | 1220 | BHANU PRATAP SINGH | 1896-01-02 |
| 9 | SIGMA | 2230 | THOMAS SHELBY | 1796-07-05 |
| 10 | SITUATIONSHIP | 2110 | SAMAY | 1996-02-01 |
+--------+-------------------+-------+--------------------+-----------------+
10 rows in set (0.00 sec)

You might also like