MySQL Workbench Reverse Engineer Won't Import Some Tables

4k views Asked by At

I am trying to learn some mysql, php, apache and yii for a personal project, which will hopefully be extended to something commercial.

I'm designing the schema on MySQL workbench and forward engineering it to the local MySQL server. Everything is good up to this point. My idea is to develop and update the database right in the server and then reverse engineering or syncing it with the Workbench for seeing it in a diagram. But when I try to reverse engineer the database, none of the tables are imported (and they actually have been created by Workbench itself.

I've tried to troubleshoot the problem and created a database on server, with just one table and with just one column in it, which is in VARCHAR datatype. This database have been reverse engineered without a glitch. But when I try to add a INT and a DATETIME column to it, it bumps into a wall:

Windows version of MySQL Workbench (6.0.8)

    WARNING: Mapping failed for datatype `int(11)`
    WARNING: Mapping failed for datatype `datetime`

Linux version of MySQL Workbench (6.0.8)

    ERROR: Line 5: SQL syntax error near 'int(11) NOT NULL,
      `name` varchar(20) DEFAULT NULL,
      `insertDate` datetime DEF'. Statement skipped.

(MySQL server Ver 14.14 Distrib 5.5.34 / on a Ubuntu 12.04 LTS box)

I should add table itself works perfectly fine when I try to add, update and delete rows.

Any ideas about what I'm doing wrong?

Edit- Based on peterm's response,

I've actually also tried syncing the model with database rather then reverse engineering, thats also not working (I was going to post some images, but couldn't due to low reputation). Under Source section, it shows an yellow exclamation mark and N/A, even though I've triple checked the table is there. In fact, it has been created by the MySQL Workbench itself!

After peterm's response, I've repeated the syncing process in order to take screenshots. While doing that I've noticed something else. When I try to update the table via MySQL Workbench, it throws the error:

Error parsing DDL for `test2`.`inttest` 
There was an error while parsing the DDL retrieved from the server.
Do you want to view the DDL or cancel processing it? 

When I click View DDL it shows the table creation script, but INT and VARCHAR keywords are in lower case.

I'm no expert, but shouldn't int's and varchars be in upper case?

And this is just in - When I try to edit the DDL on the opened window (last screenshot), MySQL workbench shuts down, and it also freezes the firefox tabs with flash player. It also shuts down my Windows virtual machine.

1

There are 1 answers

1
peterm On

Since you previously created a model use Database -> Syncronize Model instead of Reverse Engineer.

In dialog Model and Database Differences choose Update Model and click Continue.

MySQL Workbench Synchronize Model