• 2019-05-14 MySQL通过dos命令操作数据库


    use mysql;

    -- 查询数据库
    show databases;
    -- 显示表
    show TABLES;
    -- 修改用户密码
    alter user 'test'@'%' identified with mysql_native_password by 'Test12345678@';
    update user set password=password("123") where user="test";
    update mysql.user set password='123' where user='test';

    -- 查询主机 用户名 密码 命名方式
    select host,user,password,authentication_string from user;
    -- 查询 数据库下的表
    select table_name from information_schema.tables where table_schema='taotao';
    -- 查询指定数据库中指定表的所有字段名column_name
    select column_name from information_schema.columns where table_schema='taotao' and table_name='tb_content';
    -- 查询表内容
    select * from taotao.tb_content

    CREATE USER 'username'@'%' IDENTIFIED BY 'password';
    CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
    update user set host='%' where user = 'username';
    update user set host='%' where user = 'username';
    -- 给用户授权限
    GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
    -- 刷新配置
    flush privileges;

  • 相关阅读:
    ps:点阵格式图像
    ps:图像尺寸
    ps:HSB色彩模式
    git上传文件夹的问题
    sublime下载emmet
    git Octotree:提供项目目录,方便用户在线快速浏览项目结构【转载】
    git@github.com出现Permission denied (publickey)
    less:避免编译
    less:@arguments变量
    less嵌套规则
  • 原文地址:https://www.cnblogs.com/wbly2019/p/10863636.html
Copyright © 2020-2023  润新知