我试了,没问题呢
root@127.0.0.1:4000[(none)]>use test
Database changed
root@127.0.0.1:4000[test]>select version();
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v7.2.0 |
+--------------------+
1 row in set (0.00 sec)
root@127.0.0.1:4000[test]>CREATE TABLE `my_table` (
-> `id` bigint(20) NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */,
-> `name` varchar(100) NOT NULL,
-> `code` varchar(50) NOT NULL,
-> PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
-> UNIQUE KEY `uniq_system_name_idx` (`name`),
-> UNIQUE KEY `uniq_system_code_idx` (`code`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='测试';
Query OK, 0 rows affected, 1 warning (0.12 sec)
root@127.0.0.1:4000[test]>show create table my_table\G
*************************** 1. row ***************************
Table: my_table
Create Table: CREATE TABLE `my_table` (
`id` bigint(20) NOT NULL /*T![auto_rand] AUTO_RANDOM(5) */,
`name` varchar(100) NOT NULL,
`code` varchar(50) NOT NULL,
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
UNIQUE KEY `uniq_system_name_idx` (`name`),
UNIQUE KEY `uniq_system_code_idx` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='测试'
1 row in set (0.01 sec)
root@127.0.0.1:4000[test]>INSERT INTO my_table( name, code ) value ('测试','website');
Query OK, 1 row affected (0.02 sec)
root@127.0.0.1:4000[test]>select * from my_table;
+---------------------+--------+---------+
| id | name | code |
+---------------------+--------+---------+
| 4611686018427387905 | 测试 | website |
+---------------------+--------+---------+
1 row in set (0.00 sec)