Answers for "find user in mysql"

SQL
4

display users in mysql

#display all user data
select * from mysql.user;
#display username and host
select user, host from mysql.user;
Posted by: Guest on December-02-2020
1

find logged in users mysql

SELECT SUBSTRING_INDEX(host, ':', 1) AS host_short,
       GROUP_CONCAT(DISTINCT user) AS users,
       COUNT(*) AS threads
FROM information_schema.processlist
GROUP BY host_short
ORDER BY COUNT(*), host_short;
Posted by: Guest on September-15-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language