Java and MySQL
Hi...
I have an application made in Java that works fine with MySQL. However, I'm using it in a local host (all things in the same machine) and I need to allow all the computers in my LAN to have access to the database.
I've already put my database in a shared folder (where all computers in my LAN can see), but I dont know what else to do. I've changed the name of the host in my source code form //localhost to "//theHostImUsing", but I cant connect to my database.
Do I need to have a service avaliable? Does my user has to be an administrator on the LAN to be able to connect in my database? Or do I need to connect with the root account of my database?
Please, some help, Im totally lost, as you can see. And I'm not a LAN admin, so Im a noob to permissions, services, and stuff like that.
thanks in advance
[855 byte] By [
Leo77a] at [2007-11-27 5:25:55]

# 2
All you need to do is login to MySQL as root, grant privilege to the user that you use in your application to access the specific database. SPECIFY "%" as your host instead of "localhost ".
Ex.
mysql> grant all privileges on mydatabase.* to "root"@"%" identified by "password";
mysql> flush privileges;
Where:
- mydatabase is the name of your database that you want your users across your network to access it
- root is the userid you use in opening connection (not recommended)
- password is the password you use in opening connection (can be different)
It is recommeded that you don't use "root" as this is the administrator's account for all databases in MySQL..
ALSO, make sure that your MySQL database allows TCP connection in the settings. Otherwise, only application from within the localhost can access it.
# 3
First you must find out your computer name where your server is running. In Windows XP, to get computer name right click 'My Computer'. Select 'Computer Name' tab. You will see Full computer name. Say it is 'XYZ'. Start server you are using such as Apache Tomcat. You must be knowing 'http' port which is generally 8080. In address bar of your browser enter http://xyz:8080 and press enter. You must see default page which is default page of server. After that enter the path which you used to enter for local host, such as http://xyz:8080/myapplication.jsp. Same path you have to use over LAN.