通过 Plesk 上传现有数据库
我试图上传我的 ASP.NET 网站的数据库。在本地计算机上,如果我从另一台计算机复制数据库,我必须通过 SQL Server Management Studio 附加它,然后在连接字符串中使用它,例如“
<add name="cn" connectionString="Data Source=.\sqlexpress;Initial Catalog=database;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient"/>
我的数据库大约是”。目前大小为 10 MB。如果我通过 ftp 将其上传到 App_Data 文件夹,我将如何附加此数据库?
在 Plesk 中,我可以选择创建数据库及其用户(如屏幕截图所示):
1) Web 应用程序和服务 - Plesk
2) 添加新数据库 并添加新的数据库用户
3) Webadmin>ASP.ET Enterprise Manager
但这是针对我创建的新数据库的。我的问题是上传现有的。
Plesk 中还有一个用于 ASP.NET 设置的部分(如下所示) 它可以选择更改连接字符串等。
我还向我的托管提供商询问了附加我要上传的数据库所需遵循的方法。这是引用中的回复。
mdf ldf 文件也许可以工作 在你的本地计算机上但是这样 mssql 数据库无法在 Web 上运行 服务器就像在网络服务器上一样 创建和恢复您的 使用plesk备份数据库文件 控制面板。
asp.net 的示例连接字符串 mssql
标准安全性
: "Provider=SQLOLEDB;数据 来源=您的服务器名称;初始 目录= Your_Database_Name;UserId=Your_Username;Password=Your_Password;
"编码中使用的服务器名称: localhost 目录/数据库名称 , 数据库用户和数据库密码 您将需要创建您的 自己使用 plesk 控制面板“[/quote]
我真的非常感谢我上传现有数据库所必须采取的步骤。我如何附加它?我必须使用什么连接字符串? 谢谢!
I was trying to upload the database of my ASP.NET website. On the local machine, if I copy the database from another machine, I have to attach it through SQL Server Management Studio and then use it in the connection string like
<add name="cn" connectionString="Data Source=.\sqlexpress;Initial Catalog=database;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient"/>
My database is approx. 10 MB in size for now. If I upload it via ftp to App_Data folder, how would I have to attach this database?
In Plesk, I have the option to create the database and its user (as shown in the screenshots):
1) Web Applications and services-Plesk
2) Add New Database
and add new database user
3) Webadmin>ASP.ET Enterprise Manager
But this is for the new database I created. My problem is to upload an existing one.
There's also a section in Plesk for ASP.NET settings (as shown below)
This has the option to change the connection string etc.
I also asked my hosting provider about the method to be followed for attaching the database that I would upload. This was the reply in quote.
mdf ldf files perhaps will be working
at your local computer but this way
database of mssql will not work on web
server as on web server you will be
required to create and restore your
database backup file using plesk
control panel.Sample connection string for asp.net
mssqlStandard Security
:
"Provider=SQLOLEDB;Data
"
Source=Your_Server_Name;Initial
Catalog=
Your_Database_Name;UserId=Your_Username;Password=Your_Password;Server name to be used in coding:
localhost Catalog/ database name ,
database user and database password
you will be required to create your
own using plesk control panel"[/quote]
I would be really be appreciative for the steps I have to take to upload my existing database. How do I have attach it? What connection string I have to use?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 Plesk 中的“新”数据库上运行 sql 脚本吗?如果是这样,您可以在现有数据库中编写对象创建和数据的脚本并执行它。在 SSMS 中:
祝你好运!
Can you run a sql script on your "new" database in Plesk? If so, you can script the object creation and data in your existing db and execute it thusly. In SSMS:
Good luck!