我尝试使用以下代码连接MYSQL服务器:
conexionMysql = DriverManager.getConnection("jdbc:mysql://DBSERVER:1433/xTraining?user=sa&password=Phoenix14");
但总是得到同样的错误:
I/---ERROR---: Could not create connection to database server.
I/---ERROR---: 08001
W/gralloc_ranchu: Gralloc pipe failed
[ 11-16 11:22:08.532 3618: 3618 D/ ]
HostConnection::get() New Host Connection established 0xb2910380, tid 3618
[ 11-16 11:22:08.841 1509: 1534 D/ ]
HostConnection::get() New Host Connection established 0x966ff2c0, tid 1534
答案 0 :(得分:0)
您用于提供网址的语法是错误的。它是这样的:
conexionMysql = DriverManager.getConnection("jdbc:mysql://DBSERVER:1433/xTraining","sa","Phoenix14");
希望它有所帮助!