Unable to connect to MySQL database from Stash

Hi,

I am getting below error when I am trying to connect to MySQL database server from stash. Stash and db servers both are on same Linux machine.

Stash version : v2.10.1
mySQL database version : 5.5.36
JDBC Connector version : mysql-connector-java-5.1.22-bin.jar

below is error message.

The configuration entered is not valid. A database connection could not be established. Please check your configuration and try again.
com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:188)
com.atlassian.stash.internal.migration.DefaultMigrationService.validateConfiguration(DefaultMigrationService.java:87)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:35)
com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:185)
...
Could not create connection to database server. Attempted reconnect 3 times. Giving up.
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
...
null, message from server: "Host 'XXX.xx.xx.xxx' is not allowed to connect to this MySQL server"
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)

Appreciate your help.

Thanks , Venkat.

2 answers

1 accepted

This widget could not be displayed.

You need to give the user connecting to MySQL access to connect from that host.

See this stackoverflow article on how.

This widget could not be displayed.

Thank you so much. It worked.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,243 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you