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.
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.
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.
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:
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!