DB
[MySQL]show variables DB 시스템 변수 확인하기
찬란한
2022. 8. 6. 12:42
show variables는 MySQL의 시스템 변수를 조회하는 명령어이다.
이 명령어를 사용할 때는 특별한 권한이 없이도 서버에 접속만 되어있다면 어느 User라도 사용가능하다.
show variables
show variables LIKE '찾고자하는 값'
show variables LIKE '%max_connections%'
show variables LIKE '%max_connect_errors%'
show variables LIKE '%wait_timeout%'
특정 시스템 변수를 찾을 때에는 다음과 같은 명령어로 확인할 수 있다.
select @@global.max_connect_errors
select @@max_connect_errors
select @@global.max_connections;
select @@max_connections;
'@@'은 시스템변수 찾을 때 사용한다.
위와 같이 'max_connect_errors' 혹은 'max_connections' 등 기존의 시스템변수를 알고싶을 때 해당 변수앞에 접두사처럼 '@@'를 붙여주면 된다.
('@'는 사용자 정의 변수이다.)