You are on page 1of 4

Enter password: ********

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 12

Server version: 8.0.36 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 testdatabase;

Query OK, 1 row affected (0.01 sec)

mysql> create table library;

ERROR 1046 (3D000): No database selected

mysql> create table library(Id integer, Name varchar(100), book varchar(100);

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '' at line 1

mysql> CREATE TABLE library(Id integer, Name varchar(100), book varchar(100);

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '' at line 1

mysql> CREATE TABLE library(Id integer, Name varchar(100), book varchar(100));

ERROR 1046 (3D000): No database selected

mysql> CREATE TABLE library(Id integer, Name varchar(100), book varchar(100)) INTO testdatabase;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'INTO testdatabase' at line 1

mysql> SHOW DATABASES;

+--------------------+

| Database |
+--------------------+

| information_schema |

| mysql |

| performance_schema |

| sys |

| testdatabase |

+--------------------+

5 rows in set (0.01 sec)

mysql> USE testdatabase;

Database changed

mysql> CREATE TABLE library(Id integer Primary Key, Name varchar(100), title varchar(100),author
varchar(100),price integer, qty integer) ;

Query OK, 0 rows affected (0.09 sec)

mysql> desc library;

+--------+--------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------+--------------+------+-----+---------+-------+

| Id | int | NO | PRI | NULL | |

| Name | varchar(100) | YES | | NULL | |

| title | varchar(100) | YES | | NULL | |

| author | varchar(100) | YES | | NULL | |

| price | int | YES | | NULL | |

| qty | int | YES | | NULL | |

+--------+--------------+------+-----+---------+-------+

6 rows in set (0.02 sec)

mysql> SHOW VARIABLES WHERE Variable_name = 'port';

+---------------+-------+

| Variable_name | Value |
+---------------+-------+

| port | 3306 |

+---------------+-------+

1 row in set (0.02 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '%password%' WITH


GRANT OPTION;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'IDENTIFIED BY '%password%' WITH
GRANT OPTION' at line 1

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '%Abc12345%' WITH


GRANT OPTION;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'IDENTIFIED BY '%Abc12345%' WITH
GRANT OPTION' at line 1

mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;

+------------------+------------------------------------------------------------------------+-----------------------+-----------+

| user | authentication_string | plugin | host |

+------------------+------------------------------------------------------------------------+-----------------------+-----------+

| Siva | $A$005$S9j!Ej8-r;*Gx.edT4PDr0wTKkwEO6HE2Tkxx.VGdxoM4H72JfctC91 |
caching_sha2_password | %

| mysql.infoschema |
$A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
caching_sha2_password | localhost |

| mysql.session |
$A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
caching_sha2_password | localhost |

| mysql.sys |
$A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
caching_sha2_password | localhost |

| root | $A$005$4P+R2␦4A;[z5DhIQAOf83H9CBybW9vRwjyvIV8OxnFiAft3h0uvjTI0z21 |
caching_sha2_password | localhost |

+------------------+------------------------------------------------------------------------+-----------------------+-----------+

5 rows in set (0.00 sec)


mysql> GRANT ALL PRIVILEGES ON *.* TO 'siva'@'localhost' IDENTIFIED BY '%Abc12345%' WITH
GRANT OPTION;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'IDENTIFIED BY '%Abc12345%' WITH
GRANT OPTION' at line 1

mysql> GRANT ALL PRIVILEGES ON *.* TO 'siva'@'localhost' IDENTIFIED BY 'Abc12345' WITH GRANT
OPTION;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'Abc12345' WITH GRANT
OPTION' at line 1

mysql> select * from library;

+-----+----------+---------------+--------+-------+------+

| Id | Name | title | author | price | qty |

+-----+----------+---------------+--------+-------+------+

| 123 | Chandana | Corporate Law | xyz | 180 | 1 |

+-----+----------+---------------+--------+-------+------+

1 row in set (0.00 sec)

mysql> select * from library;

+---------+----------+---------------+----------+-------+------+

| Id | Name | title | author | price | qty |

+---------+----------+---------------+----------+-------+------+

| 123 | Chandana | Corporate Law | xyz | 180 | 1 |

| 23456 | ABC | port | eeee | 456 | 2 |

| 7878787 | YYYYYU | sdfsfsdfdsf | sdfsdfsd | 45454 | 2 |

+---------+----------+---------------+----------+-------+------+

3 rows in set (0.00 sec)

mysql>

You might also like