私は最初のPCでphpMyAdminにアクセスできました。ローカルLANの別のPCのブラウザhttp://192.168.100.10:8080/phpmyadmin
でphpMyAdminを開くことができます。私は、「ネットワークアクセスを許可する必要があることがわかった外部からphpMyAdminの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:そしてまた、私は別のPC
上のphpMyAdminにブラウザDBを経由して開くことができますしかし、私は、Javaコードを経由してDBへの接続を作成することはできませんMySQLへ」 phpMyAdminでこれを行う方法は?
'Class.forName'は、あなたのコード内で何もしていません。あなたの 'DriverManager'がそれを処理します。 – 4castle