This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

connecting to Datatbase from different Pcs  RSS feed

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please, I need to know if it is possible to connect MySQL database from another PC in the same LAN or maybe throw the internet
do I need to pay for this?
can I do it throw Xampp?  and how?
please, I need urgent help in that.

so again I need to connect one database using MySql from different Pcs from java code (JDBC).
what do I need to do?
 
author
Posts: 23811
140
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why shouldn't it work? The JDBC interface is designed for network access. The MySql driver supports access via machine name (or IP) and port.  And if memory serves, the JDBC driver should be using TCP, so it should route over the internet too.

Henry
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Henry Wong wrote:
Why shouldn't it work? The JDBC interface is designed for network access. The MySql driver supports access via machine name (or IP) and port.  And if memory serves, the JDBC driver should be using TCP, so it should route over the internet too.

Henry



I tried to connect from my other Pc using my IP and the port number but it didn't work and always threw exception
 
Henry Wong
author
Posts: 23811
140
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ahmed Shalotut wrote:
I tried to connect from my other Pc using my IP and the port number but it didn't work and always threw exception



... and I assume that you don't feel comfortable with Databases and Networking to debug it? Well, that is what the ranch is for... just ... TellTheDetails.

Henry
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Henry Wong wrote:

Ahmed Shalotut wrote:
I tried to connect from my other Pc using my IP and the port number but it didn't work and always threw exception



... and I assume that you don't feel comfortable with Databases and Networking to debug it? Well, that is what the ranch is for... just ... TellTheDetails.

Henry


look what I meant is that I am trying to remote connect my database using my IP address from another Pc but I don't know what is wrong.
what should I do to make it work
but I don't have problems with coding or debugging.
maybe I didn't get what you said as well.
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Henry Wong wrote:

Ahmed Shalotut wrote:
I tried to connect from my other Pc using my IP and the port number but it didn't work and always threw exception



... and I assume that you don't feel comfortable with Databases and Networking to debug it? Well, that is what the ranch is for... just ... TellTheDetails.

Henry


java.sql.SQLException: null,  message from server: "Host 'Name' is not allowed to connect to this MariaDB server"

there is the exception
 
Henry Wong
author
Posts: 23811
140
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ahmed Shalotut wrote:
what should I do to make it work
but I don't have problems with coding or debugging.
maybe I didn't get what you said as well.



Apologies. We do get a lot of users asking for help with debugging. If you don't need help with that, then, no worries.

As for the exception, it is most likely a privileges issue... but I will leave you to debug that.

Henry
 
Ahmed Shalotut
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Henry Wong wrote:

Ahmed Shalotut wrote:
what should I do to make it work
but I don't have problems with coding or debugging.
maybe I didn't get what you said as well.



Apologies. We do get a lot of users asking for help with debugging. If you don't need help with that, then, no worries.

As for the exception, it is most likely a privileges issue... but I will leave you to debug that.

Henry



You are super 😁 just done with it thanks
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!