[問題] JDBC error: Access denied for user (using password: YES)
最近小玩了一下JDBC
在用localhost做連結時還可以存取資料庫
程式碼如下:
try
{
Class.forName("com.mysql.jdbc.Driver");
connection = DriverManager.getConnection(
jdbc:mysql://localhost:3306/gmap
?useUnicode=true&characterEncoding=Big5",
"root","password");
}
catch(ClassNotFoundException e)
{
System.out.println(e.getMessage());
}
catch(SQLException e)
{
System.out.println(e.getMessage());
}
但是將localhost改成我主機的位址 140.129.19.118 時
就會出現如標題的錯誤
才看一些資料說 可能是帳密打錯
但我帳密跟本沒有變動.....
想知道板上有沒有人知道這種錯怎麼產生的
感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.160.220.45
推
04/23 23:13, , 1F
04/23 23:13, 1F
推
04/24 00:54, , 2F
04/24 00:54, 2F
推
04/24 09:51, , 3F
04/24 09:51, 3F
→
04/27 00:30, , 4F
04/27 00:30, 4F