[root@kvm3 ~]# mycli -uroot -p123qwe Connecting to socket /var/lib/mysql/mysql.sock, owned by user mysql MariaDB 10.5.16 mycli 1.26.1 Home: http://mycli.net Bug tracker: https://github.com/dbcli/mycli/issues Thanks to the contributor - Tyler Kuipers
MariaDB root@(none):(none)> use dyw; You are now connected to database "dyw" as user "root" Time: 0.001s
MariaDB root@(none):dyw> show tables; +---------------+ | Tables_in_dyw | +---------------+ | dcount | | tbl | +---------------+ 2 rows in set Time: 0.036s
MariaDB root@(none):dyw> show index from dcount\G 0 rows in set Time: 0.032s
MariaDB root@(none):dyw> alter table dcount add primary key(author); You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! Query OK, 0 rows affected Time: 0.127s
Key_name: PRIMARY 表示主鍵,Non_unique: 0 表示不重複。
Collation: How the column is sorted in the index. In MySQL, this can have values “A” (Ascending) or NULL (Not sorted).
MariaDB root@(none):dyw> show index from dcount\G ***************************[ 1. row ]*************************** Table | dcount Non_unique | 0 Key_name | PRIMARY Seq_in_index | 1 Column_name | author Collation | A Cardinality | 6 Sub_part | <null> Packed | <null> Null | Index_type | BTREE Comment | Index_comment | 1 row in set Time: 0.006s
MariaDB root@(none):dyw> alter table dcount drop primary key; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! Query OK, 6 rows affected Time: 0.105s
MariaDB root@(none):dyw> show index from dcount\G 0 rows in set Time: 0.003s