# GenerateChangeLog failed for one MySQL database

**URL:** <https://forum.liquibase.org/t/generatechangelog-failed-for-one-mysql-database/4802>\
**Category:** General Discussion\
**Created:** [November 16, 2020, 8:10am UTC](https://forum.liquibase.org/t/generatechangelog-failed-for-one-mysql-database/4802 "2020-11-16T08:10:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adarshg2](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@adarshg2](https://forum.liquibase.org/u/adarshg2)\
**Post date:** [November 16, 2020, 8:10am UTC](https://forum.liquibase.org/t/generatechangelog-failed-for-one-mysql-database/4802/1 "2020-11-16T08:10:19Z")

</div>

Hi, I have tried to generate change log for my MySQL schema but getting the below exception. I have tried the below things.  
1.removed table names with more than 30 char length.  
2. Removed all views and tried.  
3. Used --diffType

my command is below:

```
    liquibase --changeLogFile=genChangeLog_MySchema.mysql.sql \
    --logLevel=debug \
    --logFile=MySchema1.log \
    --includeSchema=true \
    --includeTablespace=true \
    --diffTypes=tables,columns,indexes,foreignkeys,primarykeys,uniqueconstraints \
    generateChangeLog

```

I am using version 4.1.1 and openjdk 11.0.8.  
Any help to solve this will be appreciated.

```
SEVERE [liquibase.integration] Unexpected error running Liquibase: java.lang.StringIndexOutOfBoundsException: begin 1, end 0, length 1
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: java.lang.StringIndexOutOfBoundsException: begin 1, end 0, length 1
	at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:251)
	at liquibase.integration.commandline.Main.doMigration(Main.java:1518)
	at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:361)
	at liquibase.Scope.lambda$child$0(Scope.java:160)
	at liquibase.Scope.child(Scope.java:169)
	at liquibase.Scope.child(Scope.java:159)
	at liquibase.Scope.child(Scope.java:138)
	at liquibase.Scope.child(Scope.java:222)
	at liquibase.Scope.child(Scope.java:226)
	at liquibase.integration.commandline.Main$1.run(Main.java:360)
	at liquibase.integration.commandline.Main$1.run(Main.java:193)
	at liquibase.Scope.child(Scope.java:169)
	at liquibase.Scope.child(Scope.java:145)
	at liquibase.integration.commandline.Main.run(Main.java:193)
	at liquibase.integration.commandline.Main.main(Main.java:156)
Caused by: liquibase.command.CommandExecutionException: java.lang.StringIndexOutOfBoundsException: begin 1, end 0, length 1
	at liquibase.command.AbstractCommand.execute(AbstractCommand.java:24)
	at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:249)
	... 14 more

```

Thanks

---

<div class="post-metadata">

**Author:** ![ronak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/ronak/32/221_2.png) [@ronak](https://forum.liquibase.org/u/ronak)\
**Post date:** [December 21, 2020, 4:26pm UTC](https://forum.liquibase.org/t/generatechangelog-failed-for-one-mysql-database/4802/2 "2020-12-21T16:26:51Z")

</div>

Hi @adarshg2,

Do you have views in your mysql database? If so, you may be running into [this](https://liquibase.jira.com/browse/CORE-3360) issue.

If this is the issue you can:

- Delete views from your database if this is an option OR
- use a [Pro license](https://www.liquibase.org/try-liquibase-pro-free), I believe that will take care of stored logic.

Hope that helps!

Ronak
