0

I'm using two tables in mysql workbench 8 and run server mariadb in xaamp When I try create a Index in a table show this message:

Operation failed: There was an error while applying the SQL script to the database. Executing:

ALTER TABLE `bd_dev`.`telefonecliente` 
ADD INDEX `idCliente` (`idCliente` ASC) VISIBLE;
;

ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 2

SQL Statement:

ALTER TABLE `bd_dev`.`telefonecliente` 
ADD INDEX `idCliente` (`idCliente` ASC) VISIBLE

someone know can I fix it? thank you

जलजनक
  • 3,072
  • 2
  • 24
  • 30
  • 1
    Going by [Alter Table - MariaDB](https://mariadb.com/kb/en/alter-table/) : `ALTER TABLE 'bd_dev'.'telefonecliente' ADD INDEX 'idCliente' ('idCliente') NOT INVISIBLE;` `VISIBLE` & `INVISIBLE` in MySQL; `MariaDB` seems to have adopted `NOT INVISIBLE` clause. – जलजनक Apr 16 '22 at 19:49
  • `VISIBLE` is supported in MariaDB-10.5.3 onward ([MDEV-22199](https://jira.mariadb.org/browse/MDEV-22199)) – danblack Apr 18 '22 at 23:50
  • Does this answer your question? [MySQL error 1064 syntax but everything seems fine](https://stackoverflow.com/questions/50393245/mysql-error-1064-syntax-but-everything-seems-fine) – gre_gor Jan 10 '23 at 07:42

1 Answers1

0

Remove the VISIBLE and it should work. Default is VISIBLE.

ALTER TABLE `bd_dev`.`telefonecliente` 
ADD INDEX `idCliente` (`idCliente` ASC) ;

Tested this on Mariadb 10.4.21-MariaDB.

khayal
  • 21
  • 5