>  Q&A  >  본문

SQL 구문 오류 1064: SQL 구문에 잘못된 "VISIBLE" 부분이 있습니다.

저는 실제로 처음으로 MySQL Workbench와 Azure Database를 사용해 보고 실험하고 있습니다. 그래서 MySQL Workbench에서 간단한 모델을 모델링하고 Azure 데이터베이스와 동기화하려고 하면 다음과 같은 오류가 발생합니다.

MySQL 워크벤치 8.0 Azure MySQL 버전: 5.7

RROR: Error 1064: 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 'VISIBLE,
  PRIMARY KEY (`emp_id`),
  UNIQUE INDEX `employee_id_UNIQUE` (`emp_id`' at line 20
SQL Code:
        CREATE TABLE IF NOT EXISTS `azcare_schema`.`employee` (
          `id` INT(11) NOT NULL AUTO_INCREMENT,
          `emp_id` VARCHAR(10) NOT NULL,
          `first_name` VARCHAR(20) NULL DEFAULT NULL,
          `middle_name` VARCHAR(30) NULL DEFAULT NULL,
          `last_name` VARCHAR(20) NULL DEFAULT NULL,
          `date_of_birth` VARCHAR(45) NULL DEFAULT NULL,
          `gender` CHAR(6) NULL DEFAULT NULL,
          `marital_status` VARCHAR(20) NULL DEFAULT NULL,
          `nationality` VARCHAR(30) NULL DEFAULT NULL,
          `passport_number` VARCHAR(20) NULL DEFAULT NULL,
          `sponser` VARCHAR(40) NULL DEFAULT NULL,
          `joining_date` DATE NULL DEFAULT NULL,
          `department` CHAR(100) NULL DEFAULT NULL,
          `education_degree` VARCHAR(45) NULL DEFAULT NULL,
          `religion` VARCHAR(30) NULL DEFAULT NULL,
          `blood_group` CHAR(4) NULL DEFAULT NULL,
          `create_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
          `update_time` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
          UNIQUE INDEX `id_UNIQUE` (`id` ASC) VISIBLE,
          PRIMARY KEY (`emp_id`),
          UNIQUE INDEX `employee_id_UNIQUE` (`emp_id` ASC) VISIBLE)
        ENGINE = InnoDB
        DEFAULT CHARACTER SET = utf8

SQL script execution finished: statements: 3 succeeded, 1 failed

Fetching back view definitions in final form.
Nothing to fetch

P粉742550377P粉742550377183일 전343

모든 응답(1)나는 대답할 것이다

  • P粉937769356

    P粉9377693562024-04-01 17:36:17

    @ErgestBasha의 제안을 기반으로 합니다. VISIBLE MySQL 8.0 이상에서 도입됨 Azure MySQL 버전은 5.7

    입니다.

    MySQL Workbench Preference-> MYSQL -> 기본 대상 MySQL 버전을 5.7로 업데이트하여 오류를 수정했습니다

    회신하다
    0
  • 취소회신하다