MySQL이 내 postfix 가상 도메인 쿼리를 "SQL 구문 오류"로 거부하는 이유는 무엇입니까?

MySQL이 내 postfix 가상 도메인 쿼리를 "SQL 구문 오류"로 거부하는 이유는 무엇입니까?

MySQL Courier + Postfix 이메일 서버에 문제가 있습니다

오류 로그는 다음과 같습니다.

warning: mysql:/etc/postfix/mysql-virtual_domains.cf: query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'virtual FROM `domains` WHERE domain='domain.example'' at line 1

그리고 다음 코드를 입력하세요 mysql-virtual_domains.cf.

user = mail_admin
password = mypassword
dbname = mail
query = SELECT domain AS virtual FROM `domains` WHERE domain='%s'
hosts = 127.0.0.1

무엇을 해야 할까요?

답변1

VIRTUAL은 MySQL의 키워드입니다.

다른 별칭을 사용하세요.식별자를 탈출하라백틱을 사용하거나.. 또는 해당 AS [alias]부분을 완전히 건너뛰세요. 구성된 맵은 virtual_alias_domains확인에만 사용됩니다.~이든어쨌든 결과가 있지, 그렇지 않아무엇결과는 다음과 같습니다

"type:table" 조회 테이블은 테이블 항목이 조회 문자열과 일치할 때 일치합니다(조회 결과는 무시됨).남자 5 postconf

관련 정보