• mysql之常用SQL语句


    查看数据库
    show databases;
    1
    进入切换数据库
    use 数据库名
    use crushlinux;
    12
    查看表
    show tables;
    1
    新建数据库,新建表
    create database 库名;
     create database yi;
    create table 表名(字段一,字段2);
    create table yi(name char(14) not null , password char(23) not null default '' ,primary key(name));
    1234
    查看表中字段
    desc 表名
     desc yi;
    12
    查询
    select 字段 from 表名 where 条件;
    select * from users;
    12
    插入数据
    insert into 表名(字段一,字段二...)  values(值1,值2....)
    insert into yi values('zhangsan','123');
    12
    更新数据
    update 表名 set 字段=值 where 条件;
    update yi
        -> set
        -> name='lisi'
        -> where name='zhangsan'
        -> ;
    123456
    删除数据
    delete from 表名 where 条件;
    delete from yi where name = 'lisi';
    12
    设置用户权限(用户不存在是创建)
    grant 命令 on 数据库名.表名  to 用户名@地址  identified by ‘密码’
    grant all on *.* to user1@'192.168.200.1' identified by '123';
    12
    刷新授权表
    flush privileges;
    1
    查看用户权限
    show grants for root@地址
    show grants for 'root'@localhost;
    12
    撤销用户权限
    revoke 权限列表 on 数据库名.表名 from 用户名@地址
    1
    显示服务器状态信息,权限信息
    show status
    show grants
    12
    显示当前时间
    show now();
    ————————————————
    版权声明:本文为CSDN博主「风之老凌」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/weixin_42480196/article/details/102480411
  • 相关阅读:
    安装 TensorFlow
    Active Learning
    基于PU-Learning的恶意URL检测
    AAAI 2018 论文 | 蚂蚁金服公开最新基于笔画的中文词向量算法
    Graph 卷积神经网络:概述、样例及最新进展
    深度学习在graph上的使用
    xgboost入门与实战(实战调参篇)
    xgboost入门与实战(原理篇)
    机器学习中的损失函数 (着重比较:hinge loss vs softmax loss)
    <html>
  • 原文地址:https://www.cnblogs.com/L1-5551/p/12419024.html
Copyright © 2020-2023  润新知