I'm developing an android native module in a react native app. I'm using JDBC to directly connect with a mysql database hosted on my pc. My Phone and pc are on same wifi network and as I'm trying to access the db I'm getting the following error.
java.sql.SQLException: Access denied for user 'root'@'172.20.24.11'(using password:YES)
The following is the code I'm using to connect the database:
try{
Connection con=DriverManager.getConnection(
"jdbc:mysql://172.20.25.207:3306/dgcis","root","root");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select COUNTRY_NAME from exp_imp_brc limit 1;");
while(rs.next())
str = rs.getString(1);
System.out.print(str);
con.close();
}
catch(Exception e){ str = e.toString();}
Also note that this code works perfectly fine on my personal laptop but I get this error when I try to run this on our company network using the company's pc.