Netbeans is not connecting with mysql

Asked

Viewed 857 times

-1

I am trying to make the connection between netbeans and mysql, but when I follow the instructions from new connection wizard netbeans appears the following message: Obs.: Netbeans IDE8.2

Can’t establish a connection to jdbc:mysql://localhost:3306/mysql? zeroDateTimeBehavior=convertToNull using with.mysql.jdbc.Driver (Could not create Connection to database server.)

Can anyone tell me how to fix this problem?

inserir a descrição da imagem aqui

  • Attach a print of your setup screen.

1 answer

1


mysql and chatinho to configure by new connection wizard because of Timezone.

Try creating the connection URL at hand. Use the new connection wizard until you get to the input part. Put the host, port and other information there. Right at the base of the wizard a url will appear. Edit it to something like this...

jdbc:mysql://localhost:3306/<nomeDoBanco>?useTimezone=true&serverTimezone=UTC

replace the "<nomeDoBanco>" by the name of the base you are using. I believe this will work.

[Edit]

Looking here at netbeans, it looks like it might be the connector you are using. Try to download a more up-to-date connector. Here has a link. Go right there at the beginning of the page, under ''files" and download the .jar. Add it in the project folder and right at the beginning of the wizard("locate driver"), choose "Mysql", click the add button and link the . jar that is in the project folder. If the problem is the connector I think so will work.

  • Hello, I made the changes but is still showing an error...I edited the post and put the image print

  • ok, so the name of your database is "mysql" right? then try using this url...jdbc:mysql://localhost:3306/mysql?useTimezone=true&serverTimezone=UTC. can paste this url directly into the "JDBC URL".

  • Can’t establish a connection to jdbc:mysql://localhost:3306/mysql? useTimezone=true&serverTimezone=UTC using with.mysql.jdbc.Driver (Could not create Connection to database server.)

  • and if I change the name of the bank:

  • Can’t establish a connection with jdbc:mysql:/localhost:3306/workout? useTimezone=true&serverTimezone=UTC using with.mysql.jdbc.Driver (Could not create Connection to database server.)

  • Are you using the right connector(.jar)? has the connector in the project libraries? what version of mysql?

  • got it this way: jdbc:mysql://localhost:3306/workout? serverTimezone=UTC .. thanks for the help!!!

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.