첫 번째 PC에서 phpMyAdmin에 대한 액세스를 허용했습니다. 로컬 LAN의 다른 PC에서 브라우저 http://192.168.100.10:8080/phpmyadmin
을 열어 phpMyAdmin을 열 수 있습니다. 또한 나는 다른 PC외부에서 phpMyAdmin의 DB에 접근하는 것을 허용하는 방법은 무엇입니까?
에 phpMyAdmin을에서 브라우저 DB를 통해 열 수 있습니다하지만 자바 코드를 통해 DB에 연결을 만들 수 없습니다 : 여기
Class.forName("com.mysql.jdbc.Driver");
// Setup the connection with the DB
Properties info = new Properties();
info.put("characterEncoding", "UTF-8");
info.put("user", "root");
info.put("password", "");
info.put("autoReconnect", "true");
info.put("useSSL", "false");
info.put("failOverReadOnly", "false");
info.put("maxReconnects", "10");
info.put("connectTimeout", "2000");
DriverManager.setLoginTimeout(10);
mConnection = DriverManager.getConnection(
"jdbc:mysql://192.168.100.10:8080/flats_flx", info
);//here it's stuck
mStatement = mConnection.createStatement();
https://stackoverflow.com/a/27700425/2425851 내가 "네트워크 액세스를 허용 할 필요가 있다는 발견을 MySQL에 " phpMyAdmin에서 어떻게합니까?
는'Class.forName' 코드에서 아무것도하지 않습니다. 'DriverManager'가 당신을 위해 그것을 처리합니다. – 4castle