USE test; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (c1 TINYBLOB, c2 BLOB, c3 MEDIUMBLOB, c4 LONGBLOB, c5 TEXT, c6 BIT(1), c7 CHAR, c8 VARCHAR(10)) CHARACTER SET = binary; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` tinyblob, `c2` blob, `c3` mediumblob, `c4` longblob, `c5` blob, `c6` bit(1) DEFAULT NULL, `c7` binary(1) DEFAULT NULL, `c8` varbinary(10) DEFAULT NULL ) ENGINE=XENGINE DEFAULT CHARSET=binary INSERT INTO t1 VALUES ('tinyblob-text readable', 'blob-text readable', 'mediumblob-text readable', 'longblob-text readable', 'text readable', b'1', 'c', 'variable'); CREATE TABLE t2(id int, `col1` binary(10),`col2` blob); SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `id` int(11) DEFAULT NULL, `col1` binary(10) DEFAULT NULL, `col2` blob ) ENGINE=XENGINE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci INSERT INTO t2 VALUES (1, X'AB1234', X'123ABC'), (2, X'DE1234', X'123DEF'); #Print the table contents when binary-as-hex option is off. SELECT * FROM t1; c1 c2 c3 c4 c5 c6 c7 c8 tinyblob-text readable blob-text readable mediumblob-text readable longblob-text readable text readable # c variable SELECT * FROM t2; id col1 col2 1 # # 2 # # #Print the table contents after turning on the binary-as-hex option #Print the table contents in tab format c1 c2 c3 c4 c5 c6 c7 c8 0x74696E79626C6F622D74657874207265616461626C65 0x626C6F622D74657874207265616461626C65 0x6D656469756D626C6F622D74657874207265616461626C65 0x6C6F6E67626C6F622D74657874207265616461626C65 0x74657874207265616461626C65 0x01 0x63 0x7661726961626C65 id col1 col2 1 0xAB123400000000000000 0x123ABC 2 0xDE123400000000000000 0x123DEF #Print the table contents in table format +------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+ | c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | +------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+ | 0x74696E79626C6F622D74657874207265616461626C65 | 0x626C6F622D74657874207265616461626C65 | 0x6D656469756D626C6F622D74657874207265616461626C65 | 0x6C6F6E67626C6F622D74657874207265616461626C65 | 0x74657874207265616461626C65 | 0x01 | 0x63 | 0x7661726961626C65 | +------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+ +------+------------------------+------------+ | id | col1 | col2 | +------+------------------------+------------+ | 1 | 0xAB123400000000000000 | 0x123ABC | +------+------------------------+------------+ #Print the table contents vertically *************************** 1. row *************************** c1: 0x74696E79626C6F622D74657874207265616461626C65 c2: 0x626C6F622D74657874207265616461626C65 c3: 0x6D656469756D626C6F622D74657874207265616461626C65 c4: 0x6C6F6E67626C6F622D74657874207265616461626C65 c5: 0x74657874207265616461626C65 c6: 0x01 c7: 0x63 c8: 0x7661726961626C65 #Print the table contents in xml format 0x74696E79626C6F622D74657874207265616461626C65 0x626C6F622D74657874207265616461626C65 0x6D656469756D626C6F622D74657874207265616461626C65 0x6C6F6E67626C6F622D74657874207265616461626C65 0x74657874207265616461626C65 0x01 0x63 0x7661726961626C65 1 0xAB123400000000000000 0x123ABC 2 0xDE123400000000000000 0x123DEF #Print the table contents in html format
c1c2c3c4c5c6c7c8
0x74696E79626C6F622D74657874207265616461626C650x626C6F622D74657874207265616461626C650x6D656469756D626C6F622D74657874207265616461626C650x6C6F6E67626C6F622D74657874207265616461626C650x74657874207265616461626C650x010x630x7661726961626C65
idcol1col2
10xAB1234000000000000000x123ABC
20xDE1234000000000000000x123DEF
DROP TABLE t1, t2;