Database connection

HaRsHaS_ V October 12, 2020

I am trying to connect my Jira sandbox account to my sql.. its giving an error that the database is not empty. I have a fresh new database and trying tot connect. i don't understand why this error is throwing up

ERROR MESSAGE

"You have specified a database that is not empty, please specify an empty database. If you want to upgrade an existing installation, please follow these instructions instead" -

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 12, 2020

hi @HaRsHaS_ V it happened to me when there was some table already created in my database. Is it really empty or some "default" table was created in the database you want to use?

Can you give us more detailed information? What type of database? What Jira version etc.?

HaRsHaS_ V October 12, 2020

@Martin Bayer _MoroSystems_ s_r_o__ 

 

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| jira |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)

mysql> CREATE DATABASE jiradb;
Query OK, 1 row affected (0.00 sec)

mysql> show tables;
ERROR 1046 (3D000): No database selected
mysql> use jiradb;
Database changed
mysql> show tables;
Empty set (0.00 sec)

jira version: 7.13.9

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 12, 2020

And for jiradb it still fails? Can you check Jira log files? ({JIRA_HOME}/logs/atlassian-jira.log)?

You should know only some versions of MySQL are supported by Jira 7.13 (https://confluence.atlassian.com/adminjiraserver0713/supported-platforms-964983071.html)

HaRsHaS_ V October 12, 2020

@Martin Bayer _MoroSystems_ s_r_o__ 

PLEASE FIND THE LOG DETAILS

 

2020-10-13 08:03:24,323 http-nio-8080-exec-14 ERROR anonymous 483x191x1 v8buqr 0:0:0:0:0:0:0:1 /secure/SetupDatabase.jspa [c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:
java.sql.SQLSyntaxErrorException: Unknown database 'jiradb'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.getTestDatabaseConnection(DefaultAtlassianBootstrapManager.java:347)
at com.atlassian.jira.config.database.JdbcDatasource.getConnection(JdbcDatasource.java:211)
at com.atlassian.jira.config.database.DatabaseConfig.testConnection(DatabaseConfig.java:88)
at com.atlassian.jira.web.action.setup.SetupDatabase.testConnection(SetupDatabase.java:225)
at com.atlassian.jira.web.action.setup.SetupDatabase.doValidation(SetupDatabase.java:189)
... 2 filtered
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63)
... 7 filtered
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
... 45 filtered
at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
... 1 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
... 31 filtered
at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
... 24 filtered
at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
... 25 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2020

@HaRsHaS_ V hm, this is weird, I guess you are using correct user - user which has permission to access database. And version of MySQL is valid?

@Adam Rypel _MoroSystems_ do you have any idea why it's not working?

Harsha Vardhan Doddi October 13, 2020

@Martin Bayer _MoroSystems_ s_r_o__ 

I got the issue resolved, Looks like I was using a java connector of higher version, i used a lower version and it worked.

 

thank you so much!

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2020

@Harsha Vardhan Doddi ok cool...so the supported platforms document should be always on mind 🙂

Suggest an answer

Log in or Sign up to answer