You cannot use either mysql
or psql
console commands to connect to Tarantool, because the communication protocol is different for each server. For the same reason, for example, you cannot connect to Posgres using the mysql
utility. However, nothing prevents you from using tarantoolctl to perform SQL requests to Tarantool. Once attached to an instance (either with tarantoolctl enter my_instance
or tarantoolctl connect <uri>
), you can switch the default language from Lua to SQL:
\set language sql
\set delimiter ;
After that you will be able to execute SQL statements directly in the console.
For the record, it's also possible to execute SQL using Lua functions, but this may seem less convenient:
box.execute([[ SELECT 1, 2, 3 ]])