[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 - John Sterling
MariaDB root@(none):(none)> use dyw; You are now connected to database "dyw" as user "root" Time: 0.002s
MariaDB root@(none):dyw> create table person(fname char(20) not null,lname char(2 -> 0) not null, gender char(10), primary key(lname,fname)); -> Query OK, 0 rows affected Time: 0.093s
MariaDB root@(none):dyw> insert ignore into person(lname,fname) values('Wang','De -> -Yu'); Query OK, 1 row affected Time: 0.020s MariaDB root@(none):dyw> select * from person; +-------+-------+--------+ | fname | lname | gender | +-------+-------+--------+ | De-Yu | Wang | <null> | +-------+-------+--------+ 1 row in set Time: 0.041s
MariaDB root@(none):dyw> insert into person(lname,fname) values('Wang','De-Yu'); (1062, "Duplicate entry 'Wang-De-Yu' for key 'PRIMARY'")
MariaDB root@(none):dyw> insert ignore into person(lname,fname) values('Wang','De -> -Yu'); Query OK, 0 rows affected Time: 0.005s MariaDB root@(none):dyw> select * from person; +-------+-------+--------+ | fname | lname | gender | +-------+-------+--------+ | De-Yu | Wang | <null> | +-------+-------+--------+ 1 row in set Time: 0.023s
MariaDB root@(none):dyw> replace into person(lname,fname) values('Lin','Linda'); Query OK, 1 row affected Time: 0.007s MariaDB root@(none):dyw> select * from person; +-------+-------+--------+ | fname | lname | gender | +-------+-------+--------+ | Linda | Lin | <null> | | De-Yu | Wang | <null> | +-------+-------+--------+ 2 rows in set Time: 0.022s
MariaDB root@(none):dyw> insert ignore into person(lname,fname,gender) values('Li -> n','Linda','F'); Query OK, 0 rows affected Time: 0.004s MariaDB root@(none):dyw> select * from person; +-------+-------+--------+ | fname | lname | gender | +-------+-------+--------+ | Linda | Lin | <null> | | De-Yu | Wang | <null> | +-------+-------+--------+ 2 rows in set Time: 0.023s
MariaDB root@(none):dyw> replace into person(lname,fname,gender) values('Lin','Li -> nda','F'); Query OK, 2 rows affected Time: 0.015s MariaDB root@(none):dyw> select * from person; +-------+-------+--------+ | fname | lname | gender | +-------+-------+--------+ | Linda | Lin | F | | De-Yu | Wang | <null> | +-------+-------+--------+ 2 rows in set Time: 0.018s