SQLServer和MySQL的连接字符串的歧义?有同样的提供者......帮助伙伴 [英] ambiguity of Connection strings of SQLServer And MySQL ? there's same providers ... help guys

查看:102
本文介绍了SQLServer和MySQL的连接字符串的歧义?有同样的提供者......帮助伙伴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里含糊不清:



以下连接字符串:





MySQL



server = ip; database = dbname; uid =用户名; PWD =密码;



现在如果我改变:



服务器到数据来源它工作。

数据库到初始目录它的工作原理。

uid到用户ID或用户名它的工作原理。

pwd密码它的工作原理。




所以它现在看起来像SQL Server连接字符串?为什么他们之间的歧义?以及使用服务器或数据源关键字之间的区别??



有人告诉我,使用含糊不清的关键字有什么好处吗?



现在从我的角度来看SQLSERVER connectionstring = MYSQL连接字符串。

There's ambiguity here :

the following connection strings :


MySQL

server = ip; database = dbname; uid= username; pwd=password;

now if i change:

server to data source it works.
database to initial catalog it works.
uid to user id or to username it works.
pwd to password it works.


So its now looks like SQL Server connection string ? why that ambiguity between them ?? and whats difference between using server or data source keywords ??

someone tell me please is there any benefits of using ambiguity keywords ?

Now from my point of view SQLSERVER connectionstring = MYSQL connection string.

推荐答案

如果你请参阅此扩展的连接字符串语法列表: http://www.connectionstrings.com/ [ ^ ],您会注意到,大多数提供商都有多个连接字符串语法。是的,你可能会发现重叠 - 尽管你错了:

SQL Server标准语法是:

If you consult this extensive list of connection string syntax: http://www.connectionstrings.com/[^], you will notice, that most providers have more than one connection string syntax. And yes, you might find overlapping - altrough you are wrong:
SQL Server standard syntax is:
Server=myServerAddress;Database=myDataBase;User Id=myUsername;<br />
Password=myPassword;



MySQL标准语法是您发布的:

Server = myServerAddress; Database = myDataBase; Uid = myUsername; Pwd = myPassword;

所以这些不相等,只是类似。但如果呢?没有。连接字符串不定义提供程序。它只是一个定义参数的字符串。供应商制造商可以选择定义此语法。这些可以协调吗?也许吧。但是谁会这样做?


MySQL Standard syntax is what you have posted:
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
So these are not equal, just similar. But what if? Nothing. Not the connection string defines the provider. It is just a string defining parameters. It is up to the provider manufacturer's choice to define this syntax. Could those be harmonized? Yes, maybe. But who would do this?


这篇关于SQLServer和MySQL的连接字符串的歧义?有同样的提供者......帮助伙伴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆