I'm a bit confused by MySQL concepts: session vs connection.
When talking about connecting to MySQL, we use connection terminology, connection pool, etc.
However in the 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?
Thanks in advance.
Literally : Connection is Physical Communication Channel and Session is a state of information exchange. A Connection may have multiple sessions . The connection is the physical communication channel between SQL Server and the application: the TCP socket, the named pipe, the shared memory region.
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.
A database connection is a session of work, opened by the program to communicate with a specific database server, in order to execute SQL statements as a specific user.
A SQL session is an occurrence of a user interacting with a relational database through the use of SQL commands. When a user initially connects to the database, a session is established.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With