I have installed MySQL to my local computer. I can access MySQL from my Java Application which is running on my computer.
My connection string is private String url = "jdbc:mysql://localhost:3306/mydatabase" which allows me to connect successfully. But when I deploy my application to other computers on my LAN and try to connect to my MySQL databases from the other computers I can’t access my database.
As others have mentioned in the comments, you issue is your connection string:
private String url = "jdbc:mysql://localhost:3306/mydatabase"In order for you to be able to connect to your database from other machines on your LAN you will need to change
localhostto your IP address. For example:private String url = "jdbc:mysql://192.168.0.10:3306/mydatabase"Providing that the other machines can see 192.168.0.10 they will be able to connect (with the right credentials of course!)