Need up to 30 seconds to load.
hi everyone this is mahalia from
cyberpanel and in today's video we will
be learning about how to list users in
my sql uh through multiple channels
now it's very important sometimes to get
to know
what users are doing within your
database and
how which users are basically logged
into your database and which one are
using your database so to check all of
that information out you need to list
users in my sql now there are many many
ways in which you can basically list the
users but today we will be using two
methods number one using command line
and number two using phpmyadmin
so without further ado let's just jump
straight to the video
okay so we're gonna go with method
number one which was which is to list
users in mysql through command line for
that you need to log into your ssh
client from here
first of all let me just log into it
first quickly okay now you need to open
your terminal console
okay let me just clear the screen up
okay so first of all what you need to do
is we need to login uh login to mysql
for that i'm going to use the command
mysql minus u
root
minus p and after that you need to enter
your
password
your sql password copy it
paste it and enter so now we have
entered our database next we need a
description of the users in the user
table so it's going to give you all the
fields within our database for that
we're going to go with the desc command
mysql
dot
user
all right so now you can see in this
table we have the field the type null
keys default extras
so it's basically giving you the
complete description of the users in the
user table okay so now we have the
description we can extract information
using that so i'll just take the host
and the user from here
so now let's get users and hosts from
this description for that
we're going to go with the select
command select user and we needed host
from my sql dot
user
make sure to enter the
semicolon in front of it once you do
that click enter
and here we go so now we have all
the users against all the host names
in a table
okay
so
lastly
the purpose of the video we're going to
do that which is list users in mysql now
let's see what every user is doing so to
see how we can uh basically list
currently logged in users we're going to
go with
again select user
db
just
command from
information
underscore schema
dot
process list
once i do that let's click enter and now
i have all the users that are currently
online and whatever they are doing right
now so this is this is how you can very
easily list users in mysql through
command line now we're going to see how
we can do the same stuff but using uh
phpmyadmin
now for that
you need
to
okay log into your cyberpanel account
from here
click on database from the left hand
side menu and click on my php my admin
okay so once this is opened you can see
it's open right over here
click on sql
and now we can enter the same command
that we enter in the command line but
you in phpmyadmin so first of all it was
mysql under root view
oh so since we have already logged into
it you can just directly go with
description
mysql dot user same colon
and after that click on go
okay so once you click on that you will
be able to see the same
result that we found uh in
uh that we found in our command line in
the same way we can have
as many uh commands to run as possible
for example right now we just did the
description uh the description one
next uh i'm gonna go with um to get
users and host from the description list
so for that select
user
host from
my sql dot
user
once i click on go it's going to give me
again
the same result it's going to give me
all the users
against my host
all right
lastly
let's just jump
to
see what the current users are doing so
for that
select
user db
command
from
information underscores
schema dot
process list
semicolon
now when i click on go again it's giving
me a
table over here in which i can see my
username the database that they're
working on and the commands that they're
doing or like whether or not what
they're doing basically within the
sql so this is how you can list users in
mysql through phpmyadmin so basically
you do the same commands but using
phpmyadmin
so that's it for today if you still have
any questions just drop a comment in the
comment section and don't forget to like
and subscribe cyberpunk