• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection refused, i can't log in to my SQL-Server

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all together.

I'm currently working on a web-application for university. First of all, the mySQL-Installation didnt work, which i fixed now. But as I try to run my code, i recieve the following exception:






As I found out by checking different ports, this error always occurs, even if there's no server running, so I guess the server is not listening, but why?
Netstat looks like this, so I think the server is running:


Btw, if I'm trying via browser:


Moreover, if I start mySQL from xampp (i run it on 3306 there), EVERY single port I try says "access denied" (and yes I'm sure the password isnt wrong ;D), also the ones where is no server running as well as 3306 itself.

So first of all: How do I get on either the SQL-Workbench started server or the xampp server?
And second: Where is even the difference? Does xampp provide an own sql server or does it start one from the software i installed??

Would be awesome if someone could help, google didnt help me at all yet and I start to retire

best regards
markus
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

You mentioned you are using port 3310, but MySQL default port is 3306.

You mentioned you have XAMP, if XAMP started can you access MYSQL?

One way to check is indeed using netstat. If you don't use netstat you can use telnet <host> <port>

Another approach is use the command line to access MySQL.
 
Markus Reis
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey there, thanks

I use port 3310 due to this Youtube Tutorial as I also had installation troubles. He then uses 3310 for fixing the problem. But on 3306 XAMPP now is running, and if I go to localhost on the browser xampp site opens, and I can also access to phpMyAdmin and create tables and databases etc, and the password there is the same as i try to use in my code. If I try to access 3306 (so the one from xampp) i get the error:



(if i open localhost:3306 in browser i get "J���
5.5.27�š���tL^sJTIQ�ÿ÷�€����������<wep(q%`4%Wj�mysql_native_password�!��ÿ„#08S01Got packets out of order)

So imo the server is running, isnt it? But why cant I contact it
 
Markus Reis
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
btw. if I test with telnet I get the same gibberish and native password stuff as if I connect via browser
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This error message

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)



confirms that you are connecting to the server, so you can stop testing for that. It is telling you that you have not configured MySQL to accept connections from the 'root' user, or that you have used the wrong password, or something like that.
 
Markus Reis
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yep thats true. But the password and user are correct, because on shell they work.

So what else could it be? How can I accept connections?
 
Paul Clapham
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You actually have to configure that in MySQL somehow. It's so many years ago that I did it, I forget how, but if I recall correctly, it isn't enough to just set up a password for the user ID. You also have to configure something which tells MySQL it's okay to accept connections from that user ID and from a particular host, or from all hosts (I think).
 
Markus Reis
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I dont know exactly what I did wrong before, but I followed the steps by this Tutorial (using my Files) and now it runs the program on localhost. Whatever I did wrong before or whoever else has the same problem, check out that link
 
reply
    Bookmark Topic Watch Topic
  • New Topic