MySQL命令(二)

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;

參考

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章