MySql数据库查版本、显示所有数据库、查询表结构等命令记录
我的mysql版本为5.7.14,若你们用以下代码并未达到预期效果,请查询是否相应版本问题。
- 查看数据库版本
第三方工具和命令行都可以使用:select version();
命令行可用:
1、 登录数据库会显示
2、mysql> status; - 查看所有数据库:
show databases; - 进入数据库A:
use A; - 查看数据库A中所有表名
select table_name from information_schema.tables where table_schema='A' and table_type='base table';
-
查询数据表
t的表结构
1、desc t;
2、describe t;
3、show columns from t; -
查询
t表的建表语句
show create table t;

浙公网安备 33010602011771号