Home >Database >Mysql Tutorial >MySQL Error 1064: Why Does 'VISIBLE' Cause a Syntax Error in MariaDB?
MySQL Syntax Error 1064, but Syntax Appears Correct
In MySQL Workbench, when attempting to add a foreign key constraint, you encounter error 1064: syntax error. The provided SQL statement appears syntactically correct, raising confusion.
Upon closer inspection, it can be identified that the problematic keyword in the statement is "VISIBLE."
Resolution:
The "VISIBLE" keyword is not supported in MariaDB, which is the underlying database engine in XAMPP. To resolve the issue, simply remove the "VISIBLE" keyword from the statement, and the operation should execute successfully.
Additional Considerations:
Why Does MySQL Workbench Add "VISIBLE"?
MySQL Workbench includes the "VISIBLE" keyword in its default SQL templates as it is supported in MySQL. However, since XAMPP uses MariaDB, it becomes incompatible.
Avoiding Future Issues:
To prevent similar issues in the future, ensure that the SQL syntax used is compatible with the underlying database engine. For MariaDB, refer to its official documentation for supported syntax. Additionally, consider using the correct connector or driver for the database in question.
The above is the detailed content of MySQL Error 1064: Why Does 'VISIBLE' Cause a Syntax Error in MariaDB?. For more information, please follow other related articles on the PHP Chinese website!