How to use the MySQL Command Line Client for running SQL commands. (Change color of MySQL console!)

welcome to everything computerized I am
CA and in this video I will be going to show you how to use the MySQL command
line client so watch this video till end and let’s get started this video is actually not a part of the
SQL tutorial but I had uploaded this video just to show you how to use the
MySQL command line client in my videos you might have noticed that the my SQL
command line client is something like this but when you first time install the
MySQL the command line client appears something like this so I want to tell
you guys that these two are exactly the same softwares and you don’t have to
worry about it previously I had uploaded a video on how to install MySQL for
running the SQL queries if you have not seen that video you can go to the
description I have given the link of that video there after the successful
installation of the MySQL on your computer you could see these all
applications are installed on your PC here you can see there are two
applications one is named MySQL 8.0 command line client and another is named
as MySQL 8.0 command line client Unicode so you guys might be wondering which
application you have to use so I want to tell you that you have to use the MySQL
8.0 command line client only the other one that is the Unicode is something
different unicode means a specific text format in
Windows or any other operating system so the commands written on this version of
command line client is somewhat different from the basic way of SQL so
for using this version you have to make some changes on your computer which
might create some problems in other applications so you just have to ignore
this and just go ahead with the default version that is the mysql 8.0 command
line client open this app and the first glimpse of the application will be
something like this in the videos which I have uploaded till now you have seen
an interface like this don’t worry I will show you how to change the
interface from this to this so when the first time you open the command-line
client it would appear something like this it
is asking for a password remember when you were installing MySQL
you were asked to set up a password so you have to enter the same password
which you had set up that time enter the same password and you could see the
MySQL server is running now it might sometimes happen that when you enter a
password the MySQL window closes so there’s nothing to worry about it it
happens when you enter a wrong password so enter the correct password that is
the password that you have set that time and the MySQL server will start running
the window will appear something like this and here you can type all the SQL
commands you want to run you can click on the maximize button to maximize the
window for your convenience in my videos I was using a different
type of interface so let’s see how you can switch to that layout so for that
you have to right-click on the title bar of this window after that you could see
these all options are available you have to click on defaults a small pop-up
window will appear on your screen here you can change the size of the text the
color and the background and each and everything about your interface to
change the size and the font of the text click on font in this section you can
change the size of the text and in this section you can change the font of the
text here is a small preview of the text how it will appear after the changes you
do to it for changing the color of the text and the background you have to
click on colors by default the background is black and the color of the
text is grey let’s change the color of the text for
that you have to click on screen text here are the different text colors which
are available I like black text on white background so I will change the text
color from grey to black and for changing the background color you have
to click on screen background and then you have to select the color which you
want so I will select white so this is how our interface will look like for
applying the changes click on OK and then close the current SQL window
and open a new SQL window because the new changes will appear from the new
window so let’s close this and open a fresh window so you can see that the
changes have been applied and the interface is like what I was using in my
videos this was about how the interface looks like let’s see how to run SQL
queries here let’s create a table so I have written a command to create a table
name tutorial with three fields into it let’s see if this command works or not
you can see it is creating an error it is saying no database selected so the
first thing before running the SQL queries is to select the database in
which we have to run the queries so we can either create a new database and
then use it or we can select from the existing databases so if you want to
create a new database you have to write the command create database database
name this will create a new database in your SQL if you want to see the
databases which are present in your computer you have to write the command
show databases it will give a list of all the databases which are present in
your computer from here you can select any database in which you want to create
the table for selecting a database you have to write the keyword you use and
then after that you have to write the name of the database which you want to
use this will select that database for the further commands which you will run
if the database that you have mentioned is present it will show a message
database change or if it is not present in the computer then it will show an
error that is unknown database a very important thing that you have to keep in
your mind is that the SQL commands always end with a semicolon and if you
don’t include this in your commands then it will give an error so this was about
the my SQL command line client I will discuss about the other common essentials
of MySQL in my upcoming videos please don’t forget to like this video and
subscribe my channel if you haven’t yet thanks for watching and see you in the
next video *subtitles by CA*

Leave a Reply

Your email address will not be published. Required fields are marked *