
结果:
说明:将多个字符串连接成一个字符串,但是可以一次性指定分隔符~(concat_ws就是concat with separator)
GROUP_CONCAT([DISTINCT] expr [,expr ...] [ORDER BY {unsigned_integer | col_name | expr} [ASC | DESC] [,col_name ...]] [SEPARATOR str_val])
说明:
DISTINCT:去除重复值
expr [,expr ...]:一个或多个字段(或表达式)
ORDER BY {unsigned_integer | col_name | expr} [ASC | DESC] [,col_name ...]:根据字段或表达式进行排序,可多个
SEPARATOR str_val:分隔符(默认为英文逗号)
group_concat()函数在处理大数据的时候,会发现内容被截取了
其实MYSQL内部对这个是有设置的,默认不设置的长度是1024,如果我们需要更大,就需要手工去修改配置文件
The port 3306 is the default MySql port.The value is ignored if Unix socket is used.
Use this to connect to a server in a replicated server configuration without concern on which server to use.
Use SSL if the server supports it, but allow connection in all cases
This option is available from Connector/NET version 6.2.1
Always use SSL. Deny connection if server does not support SSL.
This option is available from Connector/NET version 6.2.1
This option is available from Connector/NET version 6.2.1
This option is available from Connector/NET version 6.2.1
This option is available from Connector/NET version 6.2.1
This option is available from Connector/NET version 5.2.2
Returns a MySqlDateTime object for invalid values and a System.DateTime object for valid values
Returns System.DateTime.MinValue valued System.DateTime object for invalid values and a System.DateTime object for valid values.
The use of auto enlist transactionscope (default behaviour) could cause trouble in medium trust environments.
Default behaviour is that parameters for stored routines (stored procedures) are checked against the server
Some permissions and value casting related errors reported fixed when using this connection option.
The default behaviour is to read tables mysql.proc/INFORMATION_SCHEMA.ROUTINES and try to map provided command parameter values to the called procedures parameters and type cast values accordingly.
This can be troublesome if permissions to the (aforementioned) sproc info tables are insufficient.
The driver will not automatically map the parameters so you must manually set parameter types and you must also make sure to add the parameters to the command object in the exact order as appeared in the procedure definition.
This option is available from Connector/NET version 5.0.4
Specifying DefaultTableCacheAge is optional, default value is 60 seconds.
This option is available from Connector/NET version 6.4
This option is available from Connector/NET version 5.2.6
From version 6.2 idle connections are removed from the pool, freeing resources on the client (sockets) and the server (sockets and threads). Do not manually keep (global) connections and open close. Keep connection object creation and disposal as tight as possible, this might be counterintuitive but pooling mechanisms will take care of caching well and your code will be cleaner.
This is the default behaviour.
Default values are 0 and 100.
Makes an additional round trip to the server when obtaining a connection from the pool and connection state will be reset.
This is useful in load balancing scenarios when available servers change you don't want 100 constant connections in the pool pointing to only one server.
Specified in seconds, the amount of time after connection object creation the connection will be destroyed. Destruction will only happen when connections are returned to pool.
A connection might be long lived in the pool, however the connections server settings are updated (SHOW VARIABLES command) each time returned to the pool. This makes the client use of the connection object up to date with the correct server settings. However this causes a round trip and to optimize pooling performance this behaviour can be turned off.
This option is available from Connector/NET version 6.3
This option is available from Connector/NET version 6.4.4
The Windows Native Authentication Plugin must be installed for this to work.
Number of seconds between each keep-alive package send.
This option is available from Connector/NET version 6.1.1
The default is 25, meaning that stored procedure meta data (such as input/output data types etc) for the latest 25 called procedures will be cached in client memory.
This option is available from Connector/NET version 5.0.2
This enables Visual Studio wizards that bracket symbols with [] to work with Connector/Net. This option incurs a performance hit, so should only be used if necessary.
This option is available from Connector/NET version 6.3.1
Use this one to specify a default command timeout for the connection. Please note that the property in the connection string does not supercede the individual command timeout property on an individual command object.
This option is available from Connector/NET version 5.1.4.
Use this one to specify the length in seconds to wait for a server connection before terminating the attempt and receive an error.
Use this one to instruct the provider to ignore any command prepare statements and prevent corruption issues with server side prepared statements.
The option was added in Connector/NET version 5.0.3 and Connector/NET version 1.0.9.
Use this one to specify which network protocol to use for the connection.
"socket" is the default value used if the key isn't specified. Value "tcp" is an equivalent for "socket".
Use "pipe" to use a named pipes connection, "unix" for a Unix socket connection and "memory" to use MySQL shared memory.
It's possible to explicit set the shared memory object name used for communication.
It's possible to explicit set the pipe name used for communication, if not set, 'mysql' is the default value.
It is the port value of -1 that tells the driver to use named pipes network protocol. This is available on Windows only. The value is ignored if Unix socket is used.
It's possible to explicit set the shared memory object name used for communication.
Use this one to specify which character set to use to encode queries sent to the server.
Note! Use lower case value utf8 and not upper case UTF8 as this will fail.
Note that resultsets still are returned in the character set of the data returned.
连接字符串的是一个以分号为界,划分键/值参数对的列表。连接字符串包含一个由一些属性名/值对组成的集合。每一个属性/值对都由分号隔开,如下所示:PropertyName1="Value1"PropertyName2="Value2"PropertyName3="Value3".....
同样,连接字符串必须包含SQL Server实例名称: Data Source=ServerName
总的来说,数据库的连接字符串分为两种:Windows身份验证和SQL
Server身份验证。每种方法都有各自的优缺点。但是遵循的基本规则是一样的,基本规则如下:
如果采用SQL Server身份验证方式,Data Source(数据源)、Initial Catalog(初始编目)、User
ID(用户ID)、和Password(密码)等元素是必须的,下面这些选项都是可用的:
·Application Name(应用程序名称):应用程序的名称。如果没有被指定的话,它的值为.NET SqlClient Data
Provider(数据提供程序).
·AttachDBFilename/extended properties(扩展属性)/Initial File
Name(初始文件名):可连接数据库的主要文件的名称,包括完整路径名称。数据库名称必须用关键字数据库指定。
·Connect Timeout(连接超时)/Connection
Timeout(连接超时):一个到服务器的连接在终止之前等待的时间长度(以秒计),缺省值为15。
·Connection
Lifetime(连接生存时间):当一个连接被返回到连接池时,它的创建时间会与当前时间进行对比。如果这个时间跨度超过了连接的有效期的话,连接就被取消。其缺省值为0。
·Connection
Reset(连接重置):表示一个连接在从连接池中被移除时是否被重置。一个伪的有效在获得一个连接的时候就无需再进行一个额外的服务器来回运作,其缺省值为真。
·Current Language(当前语言):SQL Server语言记录的名称。
·Data Source(数据源)/Server(服务器)/Address(地址)/Addr(地址)/Network
Address(网络地址):SQL Server实例的名称或网络地址。
·Encrypt(加密):当值为真时,如果服务器安装了授权证书,SQL
Server就会对所有在客户和服务器之间传输的数据使用SSL加密。被接受的值有true(真)、false(伪)、yes(是)和no(否)。
·Enlist(登记):表示连接池程序是否会自动登记创建线程的当前事务语境中的连接,其缺省值为真。
·Database(数据库)/Initial Catalog(初始编目):数据库的名称。
·Integrated Security(集成安全)/Trusted
Connection(受信连接):表示Windows认证是否被用来连接数据库。它可以被设置成真、伪或者是和真对等的sspi,其缺省值为伪。
·Max Pool Size(连接池的最大容量):连接池允许的连接数的最大值,其缺省值为100。
·Min Pool Size(连接池的最小容量):连接池允许的连接数的最小值,其缺省值为0。
·Network Library(网络库)/Net(网络):用来建立到一个SQL Server实例的连接的网络库。支持的值包括: dbnmpntw
(Named Pipes)、dbmsrpcn (Multiprotocol/RPC)、dbmsvinn(Banyan Vines)、dbmsspxn
(IPX/SPX)和dbmssocn (TCP/IP)。协议的动态链接库必须被安装到适当的连接,其缺省值为TCP/IP。
·Packet Size(数据包大小):用来和数据库通信的网络数据包的大小。其缺省值为8192。
·Password(密码)/Pwd:与帐户名相对应的密码。
·Persist Security
Info(保持安全信息):用来确定一旦连接建立了以后安全信息是否可用。如果值为真的话,说明像用户名和密码这样对安全性比较敏感的数据可用,而如果值为伪则不可用。重置连接字符串将重新配置包括密码在内的所有连接字符串的值。其缺省值为伪。
·Pooling(池):确定是否使用连接池。如果值为真的话,连接就要从适当的连接池中获得,或者,如果需要的话,连接将被创建,然后被加入合适的连接池中。其缺省值为真。
·User ID(用户ID):用来登陆数据库的帐户名。
·Workstation ID(工作站ID):连接到SQL Server的工作站的名称。其缺省值为本地计算机的名称。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)