简体   繁体   中英

setting the target database version for mysql workbench migration

I am running a migration from sql server to mariadb 10.0 and the generated code keeps failing due to a syntax error in the create table statements.

Specifcally it doesn't like the INDEX lines of the create table statements. And example of a statement it chokes on is

CREATE TABLE t1 (
  `fk_manager` varchar(255),
  INDEX `imgr` (`fk_manager` ASC) visible
);

This is the error I get

ERROR 1064 (42000): 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 'INDEX 
`imgr` (`fk_manager` ASC) visible)' 
at line 3

If i remove the visible keyword the same command works, so I assume this is syntax valid on newer versions of mysql but not mine. Is there any way I can tell mysql workbench to exclude it?

In the top menu click Model > Model Options

In the dialogue that pops up, select MySQL on the left side

Change Target MySQL Version to 5.7

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM