尝试了解mysql的概念:session v.s.联系 [英] try to understand mysql concepts: session v.s. connection
问题描述
我对mysql概念有点困惑:会话与连接.
I'm a bit confused by mysql concepts: session vs connection.
当我们谈论连接到mysql时.我们使用连接术语以及连接池等.
When we are talking about connecting to mysql. We use connection terminology, as well as connection pool and etc.
但是,我们去mysql在线文档: http: //dev.mysql.com/doc/refman/4.1/en/server-system-variables.html .它讨论了会话变量.
However let's go to mysql online doc: http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html. It talks about session variables.
它们非常相似.如何区分它们?
They are quite similar. How to distinguish them?
提前谢谢.
推荐答案
session
仅仅是成功connection
的结果.任何MySQL客户端都需要一些连接设置来建立连接,并且在建立连接后,它会获取连接ID(线程ID)和一些称为会话的上下文.
A session
is just a result of a successful connection
. Any MySQL client requires some connection settings to establish a connection and after the connection has been established it acquires a connection id (thread id) and some context which is called session.
这篇关于尝试了解mysql的概念:session v.s.联系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!