Beata Kozieł
Beata Kozieł

Reputation: 1

How to connect payara and MySQL?

I want to connect payara server with MySQL server.

What I did?

I downloaded connector/J for MySQL.

I placed it in C:\Users\someUser\Desktop\payara5\glassfish\domains\domain1\lib\ext

I started payara server.

I created Connection Pool on localhost:4848.

I tried to ping but I had errors each time.

Details:

Errors that occured:

After trying to ping each time error occured. Each time I changed something I restarted server. I also downloaded payara again and tried. I also checked and MySQL server is running. What I did wrong or what else can I try?

Upvotes: 0

Views: 3020

Answers (3)

tm h
tm h

Reputation: 11

https://dev.mysql.com/downloads/connector/j/ download mysql driver jar through the following command add jar to payara asadmin add-library /path/to/mysql-connector-java-bin.jar delete before pool,and restart payara build new pool this is work for me

Upvotes: 1

Vijay Kumar
Vijay Kumar

Reputation: 323

I tried to configure MySql using the GUI, but I wasn't successful. I tried many ways (as described in other thread within stack overflow) to fix the issue, but was never successful using the GUI. But I tried creating the connection pool from the command prompt and was successful in the first attempt.

create-jdbc-connection-pool --ping --restype javax.sql.DataSource --datasourceclassname com.mysql.cj.jdbc.MysqlDataSource --property user=root:password=password:DatabaseName=test:ServerName=127.0.0.1:port=3306:useSSL=false:zeroDateTimeBehavior=CONVERT_TO_NULL:useUnicode=true:serverTimezone=UTC:characterEncoding=UTF-8:useInformationSchema=true:nullCatalogMeansCurrent=true:nullNamePatternMatchesAll=false MySqlPool

I would suggest others facing problem while creating connection pool via GUI, to try from the command prompt using 'asadmin'

Upvotes: 1

Hicham
Hicham

Reputation: 170

Try this with asadmin

create-jdbc-connection-pool --ping --restype javax.sql.DataSource --datasourceclassname com.mysql.cj.jdbc.MysqlDataSource --property user=root:password=password:DatabaseName=dbname:ServerName=127.0.0.1:port=3306:useSSL=false:zeroDateTimeBehavior=CONVERT_TO_NULL:useUnicode=true:serverTimezone=UTC:characterEncoding=UTF-8:useInformationSchema=true:nullCatalogMeansCurrent=true:nullNamePatternMatchesAll=false MySqlPool

Upvotes: 1

Related Questions