| Input | Output | Alias |
|---|---|---|
| ✗ | ✔ |
Description
The MySQLWire format serializes query results as a MySQL wire-protocol result set. It writes the column count and
column definitions followed by one protocol row packet for each result row and a final EOF or OK packet. The row
packets use the text protocol for normal queries and the binary protocol for prepared statements.
This is an output-only binary format intended for clients connected through ClickHouse’s
MySQL interface. The interface selects MySQLWire automatically and supplies
protocol state such as the client’s capabilities and the packet sequence number. It’s not intended for displaying or
storing query results as a standalone file.
Example usage
After enabling the MySQL interface, use a compatible client to execute a query:
mysql --protocol tcp -h 127.0.0.1 -u default -P 9004 default \
-e "SELECT number, number * 2 AS doubled FROM numbers(3)"The interface sends the result using MySQLWire; an explicit FORMAT MySQLWire clause is optional. Other explicit
output formats aren’t supported over the MySQL interface.
Format settings
There are no user-configurable format settings. The MySQL interface derives the required settings from the client handshake and the command being executed.