This section explains the different types of sessions in MySQL Shell and how to create and configure them.
The following different types of Session objects are available:
XSession: Use this session type for new application development. It offers the best integration with MySQL Server, and therefore, it is used by default. SQL execution is not supported and therefore it is not compatible with MySQL Shell's SQL Mode.
Node Session: Use this session type for SQL execution on a MySQL Server with the X Protocol enabled. SQL execution is available with this session type, therefore it can be used in MySQL Shell's SQL Mode.
This session type should only be used when connecting directly to an X Protocol enabled MySQL Server.
Classic Session Use this session type to interact with MySQL Servers that do not have the X Protocol enabled. SQL execution is available with this session type, therefore it can be used in MySQL Shell's SQL Mode.
The development API available for this type of session is very limited. For example, there are no CRUD operations, no collection handling, and binding is not supported.
MySQL Shell creates an XSession object by default. To choose which type of session should be created, use one of these options:
For more information, see Section 18.104.22.168.1, “Connecting using a URI String” and Section 22.214.171.124.2, “Connecting using Individual Parameters”.