현재 사용자 목록 확인
mysql> use mysql
mysql> select host, user from user;
+
| host | user |
+
| localhost | root |
+
사용자 추가
mysql> create user test_user1;
mysql> create user test_user2 identified by 'asdf';
mysql> create user test_user3@localhost identified by 'asdf';
mysql> select host, user from user;
+
| host | user |
+
| % | test_user1 |
| % | test_user2 |
| localhost | root |
| localhost | test_user3 |
+
사용자 삭제
mysql> drop user test_user1;
mysql> delete from user where user='test_user2';
mysql> drop user test_user3;
ERROR 1396 (HY000): Operation DROP USER failed for 'test_user3'@'%'
mysql> drop user test_user3@localhost;