0

I tried to migrate database from SQL Server 2012 to MySQL v5.5. I used MySQL workbench v6.1 community edition. What I was migrating is just schema only, not for the data. I got this error

Reverse engineer selected schemas....
Reverse engineering dbo from ElectraPortal
- Reverse engineering catalog information
- Reverse engineering User Data Types...
- Preparing...
- Gathered stats for dbo
Reverse engineering 30 tables from dbo
Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\db_mssql_grt.py", line 385, in reverseEngineer
    reverseEngineerTables(connection, schema)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\db_mssql_grt.py", line 546, in reverseEngineerTables
    table_names = [(row[0], row[1]) for row in execute_query(connection, query % schema.name) ]
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\db_mssql_grt.py", line 131, in <lambda>
    con.add_output_converter(-150, lambda value: value if value is None else value.decode('utf-16'))
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\Python\Lib\encodings\utf_16.py", line 16, in decode
    return codecs.utf_16_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode byte 0x2e in position 160: truncated data

Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\workbench\wizard_progress_page_widget.py", line 192, in thread_work
    self.func()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\migration_schema_selection.py", line 162, in task_reveng
    self.main.plan.migrationSource.reverseEngineer()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\migration.py", line 351, in reverseEngineer
    self.state.sourceCatalog = self._rev_eng_module.reverseEngineer(self.connection, self.selectedCatalogName, self.selectedSchemataNames, self.state.applicationData)
SystemError: UnicodeDecodeError("'utf16' codec can't decode byte 0x2e in position 160: truncated data"): error calling Python module function DbMssqlRE.reverseEngineer
ERROR: Reverse engineer selected schemas: UnicodeDecodeError("'utf16' codec can't decode byte 0x2e in position 160: truncated data"): error calling Python module function DbMssqlRE.reverseEngineer
Failed

What should I do?

migrated from stackoverflow.com Aug 21 '14 at 9:02

This question came from our site for professional and enthusiast programmers.

  • It suggests an issue with the character encoding of your schema. Are there any special characters in the object names? – Mark Sinkinson Aug 21 '14 at 9:19
  • If the schema is some sort of text file (i.e. you're not directly connecting to the MS SQL Server instance), you could try copying it to a Linux box and opening it with vi and just scroll down through it trying to spot any anomolies. If you can't see any, try running it again (on Linux this time) and see do you get a schema that will work on a MySQL instance. If you do want to work with Windows, then dump the Linux schema and load that on Windows. Disclaimer: this is pure guesswork. – Vérace Aug 21 '14 at 10:07
  • I use default schema (dbo). And I use default encoding which all table use english words. I used direct connection to MS SQL Server (local MS SQL 2014 Express). And of course, I used windows, not linux. So I ran MySQL workbench in windows, not linux box. – iroel Aug 21 '14 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.