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

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

See this stackoverflow article on how.

Thank you so much. It worked.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

2,048 views 1 5
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