简体   繁体   English

如何定位 Azure MySQL 数据库连接字符串?

[英]How to locate Azure MySQL database connection string?

After creating a new website in Azure (Standard S1 tier), new MySQL resources were linked.在 Azure(标准 S1 层)中创建新网站后,链接了新的 MySQL 资源。

Upon entering DB's name and saving its location, the resource with status Linked in Linked Resources tab of the web site portal becomes visible.输入 DB 的名称并保存其位置后,在网站门户的已链接资源选项卡中状态为已链接的资源变得可见。

When navigating to the Configure tab, the connection string is not visible.导航到配置选项卡时,连接字符串不可见。

In addition to that, when going to the Dashboard tab and clicking on View Connection Strings, a message: "You have no connection strings" is displayed.除此之外,当转到仪表板选项卡并单击查看连接字符串时,会显示一条消息:“您没有连接字符串”。

How do I resolve this issue?我该如何解决这个问题?

I just created a new websites and a new linked MySQL database to verify your problem.我刚刚创建了一个新网站和一个新的链接 MySQL 数据库来验证您的问题。

After creating the database I can see it on the "Linked resources" tab.创建数据库后,我可以在“链接资源”选项卡上看到它。 On the "Configure" tab I can see the connection string after that I press the "Show connection strings" link.在“配置”选项卡上,我可以在按下“显示连接字符串”链接后看到连接字符串。 Also, on the "Dashboard" tab I can see it when pressing the "View connection strings" link.此外,在“仪表板”选项卡上,按“查看连接字符串”链接时我可以看到它。

You can also check the connection string if you go to Kudu and check the configuration file for your site.如果您转到 Kudu 并检查您站点的配置文件,您还可以检查连接字符串。 Go to http://YOUR_SITE_NAME.scm.azurewebsites.net/Env#connectionStrings to see the configured connection strings.转到http://YOUR_SITE_NAME.scm.azurewebsites.net/Env#connectionStrings以查看配置的连接字符串。

I'm not sure what has happened if you are not able to see any configured connection strings.如果您看不到任何配置的连接字符串,我不确定发生了什么。 My guess is that something went wrong when saving the web sites settings or creating the database.我的猜测是在保存网站设置或创建数据库时出现问题。

I had recently a similar situation when I created a new api app.我最近在创建一个新的 api 应用程序时遇到了类似的情况。 For me, deleting and re-creating it, solved my problems.对我来说,删除并重新创建它,解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM