# Error in generated sql for mysql

**URL:** <https://forum.liquibase.org/t/error-in-generated-sql-for-mysql/1201>\
**Category:** General Discussion\
**Created:** [March 26, 2011, 4:51am UTC](https://forum.liquibase.org/t/error-in-generated-sql-for-mysql/1201 "2011-03-26T04:51:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)\
**Post date:** [March 26, 2011, 4:51am UTC](https://forum.liquibase.org/t/error-in-generated-sql-for-mysql/1201/1 "2011-03-26T04:51:00Z")

</div>

Hi,

I just started using your product. I used the generateChangeLog command to generate changelogs for an existing database I have in Postgresql. Now I want to apply these changes to a mysql database, but when I try to do that it throws an error. I’m using 2.0.1

SEVERE liquibase: Error executing SQL CREATE TABLE `blob` (`blobid` BIGINT AUTO\_INCREMENT &nbsp;NOT NULL, `object` VARCHAR(40) NOT NULL, `name` VARCHAR(64) NOT NULL, `value` bytea, CONSTRAINT `blobid` PRIMARY KEY (`blobid`))

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bytea,

Any ideas what’s going on?

---

<div class="post-metadata">

**Author:** ![gooner89](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@gooner89](https://forum.liquibase.org/u/gooner89)\
**Post date:** [March 26, 2011, 4:51am UTC](https://forum.liquibase.org/t/error-in-generated-sql-for-mysql/1201/2 "2011-03-26T04:51:00Z")

</div>

Sorry , I forgot to login before posting.

After a little tweaking I’ve found another error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bigserial&nbsp;

If it helps here’s the changeset

&nbsp;&nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;

&nbsp;&nbsp; &nbsp;

Thanks,

Suneet

---

<div class="post-metadata">

**Author:** ![gooner89](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@gooner89](https://forum.liquibase.org/u/gooner89)\
**Post date:** [March 26, 2011, 4:51am UTC](https://forum.liquibase.org/t/error-in-generated-sql-for-mysql/1201/3 "2011-03-26T04:51:00Z")

</div>

OK so I seem to have stumbled across a work around for both of them. Not sure how correct they are, but it works for postgres and mysql.

Change bigserial to bigint with auto\_increment on. and change bytea to longblob, since I would need significantly large byte array sizes in some cases.

Does anyone see a problem with this?

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [March 26, 2011, 4:51am UTC](https://forum.liquibase.org/t/error-in-generated-sql-for-mysql/1201/4 "2011-03-26T04:51:00Z")

</div>

That seems like the right approach. &nbsp;The generateChangeLog is not smart enough to change database-specific types to more generic (or other-database specific) types, so it is something you need to do manually.&nbsp;

Those conversions in particular look right.

Nathan
