Reputation: 103
I'm trying to make a java application that connects to a database that is not located on my pc. I'm not sure how to do this. If I create my own database with MySQL, where do i need to store the database in order to acces it from other computers. I want to know what do I need in order to do this. I checked the internet and saw a lot of examples using jdbc and connecting to a url with localhost or something like this. Thank you!
Upvotes: 0
Views: 95
Reputation: 530
Local: the server address will be 'localhost' or '127.0.0.1' You can install mysql on your computer and connect to it with the computer's ip (generally 192.168.1.??). You can install LAMP or MAMP to have mysql working easily on your network ('put online' option).
Internet: the server adresse is given by your host, replace the 'localhost' or '127.0.0.1' address on the jdbc parameters.
Upvotes: 2