myli
\fs sq select * from $1 limit 100;
\fs sqid select * from $1 order by id desc limit 100;
\fs ds SELECT table_schema, round(sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;
\f ds employees;
\fs ts SELECT table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES WHERE table_schema = '$1';
\f ts employees;
关于mycli更多介绍参考mycli Docs
Data
git clone https://github.com/datacharmer/test_db.git && cd test_db
mysql -uroot -p123456 -t < employees.sql
关于test_db更多介绍参考test_db
Database
SHOW DATABASES;
USE employees;
status
SHOW CREATE DATABASE employees;
\fs scd SHOW CREATE DATABASE $1;
\f scd employees;
Table
SHOW TABLES;
DESC employees;
SHOW CREATE TABLE employees;
\fs sct SHOW CREATE TABLE $1;
\f sct employees;
网友评论