MySQL--连接属性

The capability flags are used by the client and server to indicate which features they support and want to use.

Protocol::CapabilityFlags:

CLIENT_LONG_PASSWORD

Use the improved version of Old Password Authentication.

Note

Assumed to be set since 4.1.1.

Value

0x00000001

CLIENT_FOUND_ROWS

Send found rows instead of affected rows in EOF_Packet.

Value

0x00000002

CLIENT_LONG_FLAG

Longer flags in Protocol::ColumnDefinition320.

Value

0x00000004

Server

Supports longer flags.

Client

Expects longer flags.

CLIENT_CONNECT_WITH_DB

Database (schema) name can be specified on connect in Handshake Response Packet.

Value

0x00000008

Server

Supports schema-name in Handshake Response Packet.

Client

Handshake Response Packet contains a schema-name.

CLIENT_NO_SCHEMA

Value

0x00000010

Server

Do not permit database.table.column.

CLIENT_COMPRESS

Compression protocol supported.

Value

0x00000020

Server

Supports compression.

Client

Switches to Compression compressed protocol after successful authentication.

CLIENT_ODBC

Value

0x00000040

Special handling of ODBC behavior.

Note

No special behavior since 3.22.

CLIENT_LOCAL_FILES

Can use LOAD DATA LOCAL.

Value

0x00000080

Server

Enables the LOCAL INFILE request of LOAD DATA|XML.

Client

Will handle LOCAL INFILE request.

CLIENT_IGNORE_SPACE

Value

0x00000100

Server

Parser can ignore spaces before ‘(‘.

Client

Let the parser ignore spaces before ‘(‘.

CLIENT_PROTOCOL_41

Value

0x00000200

Server

Supports the 4.1 protocol.

Client

Uses the 4.1 protocol.

Note

this value was CLIENT_CHANGE_USER in 3.22, unused in 4.0

CLIENT_INTERACTIVE

wait_timeout versus wait_interactive_timeout.

Value

0x00000400

Server

Supports interactive and noninteractive clients.

Client

Client is interactive.

See

mysql_real_connect()

CLIENT_SSL

Value

0x00000800

Server

Supports SSL.

Client

Switch to SSL after sending the capability-flags.

CLIENT_IGNORE_SIGPIPE

Value

0x00001000

Client

Do not issue SIGPIPE if network failures occur (libmysqlclient only).

See

mysql_real_connect()

CLIENT_TRANSACTIONS

Value

0x00002000

Server

Can send status flags in EOF_Packet.

Client

Expects status flags in EOF_Packet.

Note

This flag is optional in 3.23, but always set by the server since 4.0.

CLIENT_RESERVED

Unused.

Value

0x00004000

Note

Was named CLIENT_PROTOCOL_41 in 4.1.0.

CLIENT_SECURE_CONNECTION

Value

0x00008000

Server

Supports Authentication::Native41.

Client

Supports Authentication::Native41.

CLIENT_MULTI_STATEMENTS

Value

0x00010000

Server

Can handle multiple statements per COM_QUERY and COM_STMT_PREPARE.

Client

May send multiple statements per COM_QUERY and COM_STMT_PREPARE.

Note

Was named CLIENT_MULTI_QUERIES in 4.1.0, renamed later.

Requires

CLIENT_PROTOCOL_41

CLIENT_MULTI_RESULTS

Value

0x00020000

Server

Can send multiple resultsets for COM_QUERY.

Client

Can handle multiple resultsets for COM_QUERY.

Requires

CLIENT_PROTOCOL_41

CLIENT_PS_MULTI_RESULTS

Server

Can send multiple resultsets for COM_STMT_EXECUTE.

Client

Can handle multiple resultsets for COM_STMT_EXECUTE.

Value

0x00040000

Requires

CLIENT_PROTOCOL_41

CLIENT_PLUGIN_AUTH

Value

0x00080000

Server

Sends extra data in Initial Handshake Packet and supports the pluggable authentication protocol.

Client

Supports authentication plugins.

Requires

CLIENT_PROTOCOL_41

CLIENT_CONNECT_ATTRS

Value

0x00100000

Server

Permits connection attributes in Protocol::HandshakeResponse41.

Client

Sends connection attributes in Protocol::HandshakeResponse41.

CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA

Value

0x00200000

Server

Understands length-encoded integer for auth response data in Protocol::HandshakeResponse41.

Client

Length of auth response data in Protocol::HandshakeResponse41 is a length-encoded integer.

Note

The flag was introduced in 5.6.6, but had the wrong value.

CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS

Value

0x00400000

Server

Announces support for expired password extension.

Client

Can handle expired passwords.

CLIENT_SESSION_TRACK

Value

0x00800000

Server

Can set SERVER_SESSION_STATE_CHANGED in the Status Flags and send session-state change data after a OK packet.

Client

Expects the server to send sesson-state changes after a OK packet.

CLIENT_DEPRECATE_EOF

Value

0x01000000

Server

Can send OK after a Text Resultset.

Client

Expects an OK (instead of EOF) after the resultset rows of a Text Resultset.

Background

To support CLIENT_SESSION_TRACK, additional information must be sent after all successful commands. Although the OK packet is extensible, the EOF packet is not due to the overlap of its bytes with the content of the Text Resultset Row.

Therefore, the EOF packet in the Text Resultset is replaced with an OK packet. EOF packets are deprecated as of MySQL 5.7.5.

时间: 2024-10-21 09:51:56

MySQL--连接属性的相关文章

redis mysql 连接池 之 golang 实现

分享一下 golang 实现的 redis 和 mysql 连接池,可以在项目中直接引用连接池句柄,调用对应的方法. 举个栗子: 1 mysql 连接池的使用 (1) 在项目子目录放置 mysql.go (2)在需要调用的地方导入连接池句柄 DB (3)调用 DB.Query() 2 redis 连接池的使用 (1)在项目子目录放置 redis.go (2)在需要调用的地方导入连接池句柄 Cache (3)调用 Cache.SetString ("test_key", "te

mysql连接的空闲时间超过8小时后 MySQL自动断开该连接解决方案 详细出处参考:http://www.jb51.net/article/32284.htm

MySQL 的默认设置下,当一个连接的空闲时间超过8小时后,MySQL 就会断开该连接,而 c3p0 连接池则以为该被断开的连接依然有效.在这种情况下,如果客户端代码向 c3p0 连接池请求连接的话,连接池就会把已经失效的连接返回给客户端,客户端在使用该失效连接的时候即抛出异常 解决这个问题的办法有三种: 1. 增加 MySQL 的 wait_timeout 属性的值. 修改 /etc/mysql/my.cnf文件,在 [mysqld] 节中设置: # Set a connection to w

[原创]java WEB学习笔记80:Hibernate学习之路--- hibernate配置文件:JDBC 连接属性,C3P0 数据库连接池属性等

本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱好者,互联网技术发烧友 微博:伊直都在0221 QQ:951226918 -----------------------------------------------------------------------------------------------------------------

查看mysql连接状态各类参数

命令: show processlist; 如果是root帐号,你能看到所有用户的当前连接.如果是其它普通帐号,只能看到自己占用的连接. show processlist;只列出前100条,如果想全列出请使用show full processlist; mysql> show processlist; 命令: show status; 命令:show status like '%下面变量%'; Aborted_clients 由于客户没有正确关闭连接已经死掉,已经放弃的连接数量. Aborted

虚拟机中MySQL连接问题:Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql

环境:在VirtualBox中安装了Ubuntu虚拟机,网络使用了NAT模式,开启了端口转发. 局域网内其他计算机访问虚拟机中的MySQL Server出现两个问题: Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql 1.解决Lost connection to MySQL server

mysql连接错误导致用户blocked

1.每过一段时间线上业务就会出现如下错误: kHost 'XXXXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host 2.需要使用mysqladmin flush-hosts解锁用户 3.查看错误日志 4.查看官方文档对max_connect_errors的解释如下     当某用户连续的错误连接达到max_c

node.js中mysql连接池的使用

https://cnodejs.org/topic/58378543bde2b59e06141f5a 起初的做法是创建一个连接然后使用,后来发现一段时间后会出现卡死不响应的情况,只有重启nodejs服务,搜索一番后想到了用连接池,经测试,不再出现卡死不响应情况. 参考链接: https://www.npmjs.com/package/mysql http://blog.csdn.net/lovingshu/article/details/41721233 Node.js mysql连接池模块 1

2.MySQL 连接与管理

mysql连接 mysql_connect() 函数用于开启一个到 MySQL 数据库的连接. 语法: mysql_connect( servername, username, password ) 返回资源型或FALSE 在 PHP 程序执行完之后,会自动关闭对数据库的连接.如果想在执行完之前就关闭数据库连接,可以使用 mysql_close() 函数: mysql_close( $conn );其参数是一个资源型变量 返回布尔值

shell命令批量杀死MySQL连接进程

(1)将所有的MySQL连接进程杀掉 for i in `mysql -uroot -pzhangyun -Bse "show processlist" | grep -v "show processlist" | awk '{print $1}'` do mysql -uroot -pzhangyun -e "kill $i" done 注:这里将自身命令的show processlist进程过滤掉 (2)删除指定用户的连接进程 for i i

Adobe Dreamweaver CC MySQL连接 报404错误的解决方法

Adobe Dreamweaver CC MySQL连接时总报404报错,并给以下两个提示: 1) 在该服务器机器上没有测试服务器运行. 2) 为该站点指定的测试服务器没有映射到http://localhost/_mmServerScripts/MMHTTPDB.phpURL.请确认url前缀映射到了你站点的根上. 网上翻了一堆网站,折腾了两三天,发现可以按如下方法解决: 1)首先要在http://localhost/security/index.php配置mysql的访问密码(我用的是XAMP