Docker 验证证据
🚀 运行/交互
CREATE TABLE → INSERT → SELECT → SHOW TABLES → EXPLAINdocker-session.out.txt
$ MYSQL_PWD=… mysql -h 127.0.0.1 -uroot -Nse 'SELECT 1'
1
$ mysql -h 127.0.0.1 -uroot -p… -e "DROP TABLE IF EXISTS hello_items; CREATE TABLE hello_items (id INT PRIMARY KEY, name VARCHAR(20), score INT); INSERT INTO hello_items VALUES (1,'Alice',30),(2,'Bob',20),(3,'Carol',40); SELECT id,name,score FROM hello_items WHERE score >= 30 ORDER BY score DESC; …"
id name score
3 Carol 40
1 Alice 30
Tables_in_hello
hello_items
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE hello_items NULL ALL NULL NULL NULL NULL 3 33.33 Using where