Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-71060

Jira doesn't start using MySQL 5.7 and setting dbconfig.xml database type to mysql57

      Issue Summary

      Jira reports incorrectly that MySQL 5.7 database is MySQL 5.6 and won't start Jira when the dbconfig.xml has the database type set to mysql57.

      Steps to Reproduce

      1. Install MySQL 5.7 and set the following.

        character_set_client utf8
        character_set_connection utf8
        character_set_database latin1
        character_set_filesystem binary
        character_set_results utf8
        character_set_server latin1
        character_set_system utf8
        collation_connection utf8_general_ci
        collation_database latin1_swedish_ci
        collation_server latin1_swedish_ci
        version 5.7.30-0ubuntu0.18.04.1

      1. In the dbconfig.xml set the database type to mysql57
      2. Set URL to change the character_endcoding to utf8mb4
      3. Restart Jira

      Expected Results

      Jira will start and use the MySQL 5.7 database.

      Actual Results

      Jira won't start as a result of the default settings. with the URL set with character_endcoding= utf8mb4

      2020-04-27 08:39:23,137-0700 JIRA-Bootstrap ERROR [c.a.jira.health.HealthChecks] We've found an error in MySQL supported version!
      2020-04-27 08:39:23,137-0700 JIRA-Bootstrap ERROR      [c.a.jira.health.HealthChecks] The database type in your dbconfig.xml is set up to MySQl 5.7+ and your MySQL version is 5.6 or lower. Consider using MySQL 5.6 database type instead
          See our documentation for more information on changing database type.
      2020-04-27 08:39:23,137-0700 JIRA-Bootstrap ERROR      [c.a.jira.health.HealthChecks] JIRA couldn't connect to your database
      2020-04-27 08:39:23,137-0700 JIRA-Bootstrap ERROR      [c.a.jira.health.HealthChecks] JIRA failed to establish a connection to your database.
          This could be because:
          	- Your database isn't running
          	- The configuration of your dbconfig.xml file is incorrect (user, password, or database URL etc.)
          	- There is a network issue between JIRA and your database (e.g. firewall, database doesn't allow remote access etc.)
          
          There are several other solutions you can try, review our documentation, and see what works for you.
      
      

      Old keeping for reference - Workaround

      Currently, there is no known workaround.

      If you change the dbconfig.xml to use the database type mysql rather than mysql57 Jira starts however you will get a collation warning by the health checker stating utf8mb4 is not a supported collation.

      Note on Resolution

            [JRASERVER-71060] Jira doesn't start using MySQL 5.7 and setting dbconfig.xml database type to mysql57

            https://getsupport.atlassian.com/browse/GHS-241531

            Here are all changes we have made to fixed the issue:

            1. Changed character set and collation settings for DB, tables, and columns according to the article
              How to Fix the Collation and Character Set of a MySQL Database manually
            2. Changed the database type in dbconfig.xml file from mysql to mysql57
            3. We have upgraded the database connector from v 5.1.22 to 5.1.49
            • Note that applying the first two changes caused Jira not to start. Jira started properly after changing the driver.

            Barış Türkkal added a comment - https://getsupport.atlassian.com/browse/GHS-241531 Here are all changes we have made to fixed the issue: Changed character set and collation settings for DB, tables, and columns according to the article How to Fix the Collation and Character Set of a MySQL Database manually Changed the database type in dbconfig.xml file from mysql to mysql57 We have upgraded the database connector from v 5.1.22 to 5.1.49 Note that applying the first two changes caused Jira not to start. Jira started properly after changing the driver.

            I ran into the same problem, and here's what worked for me;

            Aliaswire Inc added a comment - I ran into the same problem, and here's what worked for me; set database-type to mysql57 in dbconfig.xml Set these settings in mysql server configuration : https://confluence.atlassian.com/adminjiraserver/connecting-jira-applications-to-mysql-5-7-966063305.html . Particularly:  character_set_server=utf8mb4

            bb073e2d8784 Connector/J v8.0.28

            Yevgen Lasman added a comment - bb073e2d8784 Connector/J v8.0.28

            Andrew added a comment -

            Please include the installed version of MySQL Connector-J in your investigations. 

            Andrew added a comment - Please include the installed version of MySQL Connector-J in your investigations. 

            Loc Nguyen (Inactive) added a comment - https://getsupport.atlassian.com/browse/GHS-236471

            I have brand new Jira 8.21.1 and MySQL 5.7.36 setup and despite character sets and collations being absolutely correct, application can't connect to the database as long as <database-type> is set to mysql57. What's worst here, is that Jira can't be configured from the UI during the first start, it just fails to connect to the database because its code tries to use mysql57

            Yevgen Lasman added a comment - I have brand new Jira 8.21.1 and MySQL 5.7.36 setup and despite character sets and collations being absolutely correct, application can't connect to the database as long as <database-type> is set to mysql57 . What's worst here, is that Jira can't be configured from the UI during the first start, it just fails to connect to the database because its code tries to use mysql57

            I am having the same problem.  Only work around for this is to manually set in dbconfig.xml <database-type>mysql</database-type>, the Jira instance will start fine, I get no errors.  I only get errors if set to utf8mb4.  MySQL is setup for utf8mb4, excluding character_set_system (which is fine), and as well: character_set_server, and collation_server. When editing .ini file for MySQL  setting any of these character_set_server, collation_server =, etc lines in my .ini file breaks the MySQL. 

            My character_set_server and collation_server is set too: latin1 

            I have tried many workarounds... set character_set_server = utf8mb4, which this will set the variable for a moment, but after a reboot/restart of the service it reverts back to .ini file.  

            I am scared to patch Jira any further...hopefully there will be an update or resolution for this issue, if there is and I am just missing it. Please let me know!

            Thank you!

             

            Alexander Badich added a comment - I am having the same problem.  Only work around for this is to manually set in dbconfig.xml <database-type>mysql</database-type>, the Jira instance will start fine, I get no errors.  I only get errors if set to utf8mb4.  MySQL is setup for utf8mb4, excluding character_set_system (which is fine), and as well: character_set_server, and collation_server. When editing .ini file for MySQL  setting any of these character_set_server, collation_server =, etc lines in my .ini file breaks the MySQL.  My character_set_server and collation_server is set too: latin1  I have tried many workarounds... set character_set_server = utf8mb4, which this will set the variable for a moment, but after a reboot/restart of the service it reverts back to .ini file.   I am scared to patch Jira any further...hopefully there will be an update or resolution for this issue, if there is and I am just missing it. Please let me know! Thank you!  

            0ea6fafdf90b
            Thanks for confirming that the utf8mb4 character_set_server works fine.

            Andriy Yakovlev [Atlassian] added a comment - 0ea6fafdf90b Thanks for confirming that the utf8mb4 character_set_server works fine.

            Jira is now working with utf8mb4. Thank you.

            haas_bitbucket added a comment - Jira is now working with utf8mb4. Thank you.

            Steps to reproduce are not in sync with Atlassian guidelines how to configure MySql database. According to page https://confluence.atlassian.com/adminjiraserver088/installing-jira-applications/connecting-jira-applications-to-a-database/connecting-jira-applications-to-mysql-5-7 character_set_server variable should be set to utf8mb4, not latin1 like here.

            I verified Jira 8.8.0 with MySql 5.7.24 running inside docker and MySql 5.7.30-0ubuntu0.16.04.1 running on Ubuntu using JDBC drivers 8.0.20 and 5.1.48. There were no problems connecting to and using that database.

            Mikolaj Rydzewski (Inactive) added a comment - Steps to reproduce are not in sync with Atlassian guidelines how to configure MySql database. According to page  https://confluence.atlassian.com/adminjiraserver088/installing-jira-applications/connecting-jira-applications-to-a-database/connecting-jira-applications-to-mysql-5-7   character_set_server variable should be set to utf8mb4 , not latin1 like here. I verified Jira 8.8.0 with MySql 5.7.24 running inside docker and MySql 5.7.30-0ubuntu0.16.04.1 running on Ubuntu using JDBC drivers 8.0.20 and 5.1.48. There were no problems connecting to and using that database.

              mrydzewski Mikolaj Rydzewski (Inactive)
              estorch Eric Storch (Inactive)
              Affected customers:
              4 This affects my team
              Watchers:
              18 Start watching this issue

                Created:
                Updated:
                Resolved: