wasup
MySQL) 유저목록 확인하기 - SELECT user, HOST FROM user; 본문
반응형
컨테이너 접근
docker exec -it mysql1 bash
C:\Users\W>docker exec -it mysql1 bash
root@a8526aa51bb7:/# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.7.34 MySQL Community Server (GPL)
Copyright (c) 2000, 2021, 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.
SHOW DATABASES; #DB보기
USE mysql #DB선택
SELECT user, HOST FROM user; #유저목록확인
SHOW GRANTS FOR user1; #권한확인
SHOW DATABASES;
USE mysql;
SELECT user, HOST FROM user;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| studydb |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select user, host from user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| root | % |
| user1 | % |
| user2 | % |
| user3 | % |
| user4 | % |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
8 rows in set (0.00 sec)
mysql> show grants for user1;
+--------------------------------------------+
| Grants for user1@% |
+--------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'user1'@'%' |
+--------------------------------------------+
1 row in set (0.00 sec)
반응형
'DataBase > MySQL' 카테고리의 다른 글
MySQL) 예제 sql문 (0) | 2021.05.25 |
---|---|
MySQL) 권한취소 - REVOKE, 유저삭제 - DROP USER (0) | 2021.05.24 |
MySQL) 권한부여- GRANT (0) | 2021.05.22 |
MySQL) workbanch설치 및 테스트할 내용 메모 (0) | 2021.05.21 |
MySQL) JOIN#2. left join, right join (0) | 2021.05.20 |
Comments