zoukankan      html  css  js  c++  java
  • 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;

  • 相关阅读:
    alloffthelights使用方法
    tweenMax学习笔记
    移动端获取手机摄像头和相册
    livereload使用方法
    Bower使用笔记
    github 远程仓库
    git for windows 本地仓库
    python 对文件操作
    Python 装饰器
    JavaScript 做的网页版扫雷小游戏
  • 原文地址:https://www.cnblogs.com/wbly2019/p/10863636.html
Copyright © 2011-2022 走看看