您当前的位置: 首页 >  sql

星球守护者

暂无认证

  • 3浏览

    0关注

    641博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

linux下Mysql查询语句

星球守护者 发布时间:2019-09-02 19:37:17 ,浏览量:3

一.查询 库和表信息

mysql> show databases; 查看数据
mysql> use mysql;进入数据库
mysql> show tables; 看当前库中有哪些表

在这里插入图片描述

二.查询表内容

mysql> select * from mysql.user; 查看表内容
mysql> desc  mysql.user;  查看表结构,可以看到字段类型,以及主键值字段

在这里插入图片描述

mysql> select host,user,password from mysql.user; 按照字段查询
mysql> select host,user,password from mysql.user where user="root"; 按条件查询
mysql> select host,user,password from mysql.user where user="root" and host="localhost";  两个

在这里插入图片描述

条件同时满足
mysql> select host,user,password from mysql.user limit 3; 查询3行

在这里插入图片描述

关注
打赏
1662051426
查看更多评论
立即登录/注册

微信扫码登录

0.2139s