Home > Database > Mysql Tutorial > body text

Why Does MySQL Workbench Generate Syntax Errors with 'VISIBLE' in CREATE INDEX Statements?

Linda Hamilton
Release: 2024-11-14 10:27:02
Original
207 people have browsed it

Why Does MySQL Workbench Generate Syntax Errors with

MySQL Workbench: Syntax Error with "VISIBLE" in CREATE INDEX Statement

When creating a unique index in MySQL, a syntax error may occur with the use of the "VISIBLE" keyword. This issue typically arises when using the latest version of MySQL Workbench with an older version of the MySQL server, such as MySQL 5.7.

Syntax Difference Across MySQL Versions

The "VISIBLE" keyword, which controls the visibility of an index, is a feature available in MySQL server version 8.0 and above. However, in MySQL 5.7, this keyword is not supported.

Auto-Generated Statements by MySQL Workbench

MySQL Workbench 8.0.12 automatically generates CREATE UNIQUE INDEX statements with the "VISIBLE" keyword. This can lead to syntax errors when executing these statements in MySQL 5.7.

Disabling Auto-Generation of "VISIBLE"

To prevent MySQL Workbench from automatically adding the "VISIBLE" keyword, the default target MySQL version can be adjusted in the MySQL Workbench preferences.

Steps to Disable Auto-Generation:

  1. In MySQL Workbench, navigate to "Edit > Preferences > Modeling > MySQL."
  2. Set the "Default Target MySQL Version" to 5.7.

By setting this preference, MySQL Workbench will no longer generate statements with the "VISIBLE" keyword when executing CREATE UNIQUE INDEX statements for MySQL 5.7 servers.

The above is the detailed content of Why Does MySQL Workbench Generate Syntax Errors with 'VISIBLE' in CREATE INDEX Statements?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template