phpMyAdmin 数据库的连接字符串

发布于 2024-10-04 05:13:34 字数 237 浏览 0 评论 0原文

如果我自己的电脑上有一个 mysql 数据库,我将使用以下 cnxn 字符串将其连接到我的 java 程序:

String url = "jdbc:mysql://localhost:port/dbname";

但如果我的数据库是通过 phpMyAdmin 创建的,连接字符串是什么? 另请注意,phpmyadmin 数据库现在不在我的本地电脑上,它在另一台电脑上,但两台电脑都在同一网络中。

感谢您的帮助..

If I have a mysql database on my own pc, I would use the following cnxn string to connect it to my java program :

String url = "jdbc:mysql://localhost:port/dbname";

But if my database is made over phpMyAdmin, what would be the connection string ?
one other note, the phpmyadmin database is not on my local pc now, it is on another one but both pc are in the same network.

Thanks for any help ..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

茶色山野 2024-10-11 05:13:34

phpMyadmin是在PHP平台上开发的管理Web应用程序。 phpMyadmin 连接到可能位于其他计算机上的 MySQL 数据库。

您需要检查phpMyadmin的config.inc.php文件来检查mysql数据库的主机和端口。

获得 mysql 数据库的 IP 和端口后,您可以使用连接字符串进行连接,例如

jdbc:mysql://<ipaddress>:<port>/<database_created_through_phpMyAdmin>

phpMyadmin is administration web application developed on PHP platform. phpMyadmin connects to MySQL database that might be on other machine.

you need to check config.inc.php file of phpMyadmin to check the host and port of mysql database.

Once you get the IP and port of the mysql database you can connect using connect string like

jdbc:mysql://<ipaddress>:<port>/<database_created_through_phpMyAdmin>
猥︴琐丶欲为 2024-10-11 05:13:34

将 localhost 替换为托管数据库的计算机的 IP:

String url = "jdbc:mysql://<ip_goes_here>:port/dbname";

正如 Rutesh 提到的,这可能是也可能不是 phpMyAdmin 运行的同一台计算机。

Replace localhost with the IP of the machine that hosts your database:

String url = "jdbc:mysql://<ip_goes_here>:port/dbname";

As Rutesh mentions, this may or may not be the same machine on which phpMyAdmin runs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文