MySQLSyntaxErrorException for OPTION SQL_SELECT_LIMIT=500 when using MySQL

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

 

 

問題

 MySQL database configuration setup fails and the following appears in the atlassian-bitbucket.log

The schema could not be created.
com.atlassian.stash.internal.db.DefaultDatabaseManager.createSchema(DefaultDatabaseManager.java:341)
com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:191)
com.atlassian.stash.internal.maintenance.SpringMaintenanceTaskFactory.setupTask(SpringMaintenanceTaskFactory.java:151)
...
Error creating bean with name 'liquibasePrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set liquibase/r3_2/upgrade.xml::STASHDEV-6754-2::jhinch:
Reason: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: 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 'OPTION SQL_SELECT_LIMIT=500' at line 1
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
...
Migration failed for change set liquibase/r3_2/upgrade.xml::STASHDEV-6754-2::jhinch:
Reason: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: 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 'OPTION SQL_SELECT_LIMIT=500' at line 1
liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
...
...
error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=500' at line 1
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

原因

  • MySQL driver installed is relatively old.

ソリューション

  1. Stop Bitbucket Server.
  2. Move the old mysql-connector-java-5.1.XX-bin.jar driver from <Bitbucket home directory>/lib to a backup location.
    1. Ensure that only 1 version of the driver file exists in the lib directory.
  3. Download the latest driver from http://dev.mysql.com/downloads/connector/j/ to <Bitbucket home directory>/lib.
  4. Start Bitbucket Server.

 

最終更新日: 2017 年 9 月 9 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.