跳转到正文

Docker 验证证据 ​

MySQL 已验证 · Verified 🕒 快照采集: 2026-08-23 15:15:53 UTC
🐳 镜像:server:由 MYSQL_IMAGE 锁定
🛠️ 关键工具:mysqldmysqlmysqladminmysqldump
🚀 运行/交互CREATE TABLE → INSERT → SELECT → SHOW TABLES → EXPLAIN
docker-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

Released under the MIT License.