MySQL 사용자 이름 생성시 읽어볼만 한 것
Specifying Account Names
1) Account name syntax is 'user_name'@'host_name'.
2) 작은 따옴표가 있어도 되고 없어도 된다.
'aaaa'@'abc.com' = aaaa@abc.com 이다.
'aaaa'@'abc.com' != 'aaaa@abc.com' 이다.
3) user_name(user 테이블의 user column)은 대소문자를 가린다. User values are case-sensitive
host_name(user 테이블의 host column)은 대소문자를 가리지 않는다. Host values are not case-sensitive
4) host_name에 wildcard 사용가능(%, _)
가능한 것
127.0.0.1, localhost, ::1, %.mysql.com, 192.168.100.%, 198.51.100.0/255.255.255.0, 198.51.100.0/255.255.0.0
불가능 한것
192.168.100.aaa.com, 198.051.100.%
current_user() 명령어로 현재 접속중인 사용자를 볼 수 있다.
사용자라 하면 user_name과 host 를 함께 지칭한다.
https://dev.mysql.com/doc/refman/8.0/en/account-names.html
MySQL :: MySQL 8.0 Reference Manual :: 6.2.4 Specifying Account Names
6.2.4 Specifying Account Names MySQL account names consist of a user name and a host name, which enables creation of distinct accounts for users with the same user name who can connect from different hosts. This section describes how to write account names
dev.mysql.com