-1

根据此链接,要连接到 mysql 数据库,请使用以下字符串:

jdbc:mysql://localhost:3306/sakila?profileSQL=true

我有一个远程 linux vm 来托管我的 mysql 数据库,而不是 localhost。登录该虚拟机的凭据在哪里?

4

2 回答 2

1

只需将 localhost 替换为远程 linux 的机器名即可。您无需登录远程虚拟机,因为您将直接连接到暴露的 3306 端口。只需在连接字符串中填写您的数据库用户的凭据,就足够了。

于 2013-08-05T10:38:50.717 回答
0

试试这个

jdbc:mysql://localhost/test?user=root&password=root

于 2013-08-05T10:37:58.337 回答