MySQL error 1064 syntax but everything seems fine

Solution 1:

Problem is the word VISIBLE, remove it and it will work. Index are visible by default.

Your question: "If i remove VISIBLE it works just fine, so why did mysql workbench decided to add visible?"

My answer: The option to mark index invisible is not yet implemented in MariaDB (afaik!).

Update:

The syntax for MariaDB is different, please see this reference: https://jira.mariadb.org/browse/MDEV-7317

Solution 2:

Just to add to those who are using Maria DB with MySQL Workbench, you don't need to install mysql. You can just change 'Default Target MySQL Version' from Preferences to 5.7 or 5.6, and the VISIBLE keyword will be removed by workbench. MySQL Workbench Preference Changes

Here is a link from mysql bugs https://bugs.mysql.com/bug.php?id=92269

Solution 3:

I am using MySQL Workbench and have same problem. Change in the Preferences but it did not work.

Solution: If you export forward-engineer the model you need to change the configuration on another place.

  1. Go to Model > Model Options
  2. Inside the Model Options, go to MySQL
  3. Then change the "Target MySQL Version" to 5.6

example here