mysql常用命令行語句

------cmd連接本地數據庫

mysql -u用戶名  -p

------cmd連接遠程數據庫

mysql -u用戶名 -h主機名/主機IP -p
eg: mysql -ugt -h10.24.88.60 -p

------查看所有數據庫名

show databases;

------使用數據庫

use 數據庫名;
eg:use db

------查看使用數據庫下所有表

show tables;
#也查看指定數據庫下的所有表名
select table_name from information_schema.tables where table_schema='當前數據庫';

------查看某表的全部字段

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