I want to connect to a MySQL database. When installing MySQL, I did not enter any password, so in my program I did the same, but I get an error message when connecting. I use the properties file to get the driver, URL, username and password. Help me pleas.
This is my code:
try { Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/easylibdb1","root",""); } catch (Exception e) { System.out.println("Got Error While Connecting To Database...!"); e.printStackTrace(); }
This is my property file contents:
driver=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.1.51:3306/easylibdb1 user=root password=""
source share