I'm trying to make a java program for a library management systems that uses a mySQL database. My current code allows for myself to access the database freely because it's the same computer hosting the database. I'm trying to make it so any computer on my same network running the application can access the database. I've done some research and found that I apparently need to comment out this bind-address line, but I can't find it in my my.ini file. I don't know if it will help because i'm fairly new to this but I'll leave here the current code im using to connect to the database in java. Overall im hoping to edit this code and configuration file to allow users on the same network to access this databse im hosting from my laptop.
package librarymanagement;
import java.sql.*;
public class ConnectionDB {
final String dbURL = "jdbc:mysql://localhost:3306/library?useSSL=false";
final String dbUser = "root";
final String dbPassword = "testPass";
public Connection connectDB(){
Connection con = null;
try {
Class.forName("com.mysql.cj.jdbc.Driver");
con = DriverManager.getConnection(dbURL,dbUser,dbPassword);
//Multi catch statement that handles SQL exceptions
//and ptints which line the error has occurred at
} catch (ClassNotFoundException | SQLException ex) {
ex.printStackTrace();
}
return con;
}
What should I do as that bind-address line is not in the my.ini file.
I've already through the my.ini file throughroughly yet still cant find the bind-address line.