Connect Netbeans to XAMPP-VM mysql

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Connect Netbeans to XAMPP-VM mysql

Postby sotonj » 17. March 2020 00:28

First of all, I am new in programing, I grateful for your help.

when I try to connect from Netbeans with mysql using XAMPP-VM , the system give me this error:

Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.


This are my lines of code from Netbeans (java) for connection:

try{

Connection cn = DriverManager.getConnection("jdbc:mysql://localhost:8080/bd_ins","root","");

}catch (SQLException e){

System.out.println(e.getMessage());
System.out.println(e.getErrorCode());

}

My operating System is OS X Capitan
In Netbeans I am using this driver: mysql-connector-java-5.1.46.jar

XAMPP-VM is working right because all services are on: Apache, MySql. When I put: http://localhost:8080/phpmyadmin/ in the browser, this works

Thanks for your help, I am stuck since 4 days
sotonj
 
Posts: 2
Joined: 17. March 2020 00:05
XAMPP version: VM
Operating System: OS X Capitan

Re: Connect Netbeans to XAMPP-VM mysql

Postby Nobbie » 18. March 2020 10:02

The Port is wrong in the connection, 8080 is for http and not for Mysql. Apply 3306 instead of 8080.
Nobbie
 
Posts: 11918
Joined: 09. March 2008 13:04

Re: Connect Netbeans to XAMPP-VM mysql

Postby sotonj » 18. March 2020 23:02

Thanks for your answer, I changed the port and changed localhost for my IP and it didn´t work. Then, I searched the file my.cnf and edit the section : [mysqld],

I added this:

skip-grant-tables

and it works

Thank you so much for your help,
sotonj
 
Posts: 2
Joined: 17. March 2020 00:05
XAMPP version: VM
Operating System: OS X Capitan

Re: Connect Netbeans to XAMPP-VM mysql

Postby marc.elbet@orange.fr » 04. February 2021 13:58

I Thanks for the advice.
I tried it but it didn’t work.

The previous “non-vm” XAMPP worked wonders with NetBeans and Chrome (I used it for years) but XAMPP-VM just doesn’t.

When hitting the “RUN” icon I just get the “local host doesn’t allow connection" and the path in the navigation path is wrong:
I get http://localhost/MY_DB/index.php
when it should be:http://localhost:8080/Project1/MY_DB/index.php

What the hell did I do wrong as the project creation was OK.
Any help will be appreciated.
Cheers.

Marc
marc.elbet@orange.fr
 
Posts: 2
Joined: 04. February 2021 13:37
XAMPP version: xampp-vm
Operating System: MAC OS CATALINA 10.15.7

Re: Connect Netbeans to XAMPP-VM mysql

Postby Altrea » 04. February 2021 15:00

marc.elbet@orange.fr wrote:The previous “non-vm” XAMPP worked wonders with NetBeans and Chrome (I used it for years) but XAMPP-VM just doesn’t.

So why don't you install the installer version instead?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 10730
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Connect Netbeans to XAMPP-VM mysql

Postby marc.elbet@orange.fr » 05. February 2021 09:13

I did’nt know there was one.
Can you give me more details, eg: where to get it.
I reckon somedoc will be available with the product.
Many thanks
I appreciate your help
Marc
marc.elbet@orange.fr
 
Posts: 2
Joined: 04. February 2021 13:37
XAMPP version: xampp-vm
Operating System: MAC OS CATALINA 10.15.7

Re: Connect Netbeans to XAMPP-VM mysql

Postby Altrea » 05. February 2021 09:38

At the download page: https://www.apachefriends.org/download.html

There are big files (~360Mb). These are the VM versions.
And there are small files (@160Mb). These are the Installer versions.
You can distinguish them by their file name too. The vm versions contain vm in the filename, the installer versions contain installer in their filename.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 10730
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 6 guests