[root@kvm3 ~]# mycli -S /var/lib/mysql/mysql.sock -uroot -p123qwe mariadb 10.3.11-MariaDB mycli 1.20.1 Chat: https://gitter.im/dbcli/mycli Mail: https://groups.google.com/forum/#!forum/mycli-users Home: http://mycli.net Thanks to the contributor - Lewis Peckover
mariadb root@localhost:(none)> use dyw; You are now connected to database "dyw" as user "root" Time: 0.001s
mariadb root@localhost:dyw> show tables; +---------------+ | Tables_in_dyw | +---------------+ | dcount | | tbl | +---------------+ 2 rows in set Time: 0.022s
mariadb root@localhost:dyw> show index from dcount\G mariadb root@localhost:dyw>
mariadb root@localhost: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.038s
Key_name: PRIMARY
表示主鍵,Non_qunique: 0
表示不重複。
Collation: How the column is sorted in the index. In MySQL, this can have values “A” (Ascending) or NULL (Not sorted).
mariadb root@localhost: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.012s
mariadb root@localhost: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.043s
mariadb root@localhost:dyw> show index from dcount\G mariadb root@localhost:dyw>