• sql修改权限文档


    mysql权限回收

    1、模拟test环境
    检查库是否utf8
    SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';

    +--------------------------+-----------------+
    | Variable_name | Value |
    +--------------------------+-----------------+
    | character_set_client | utf8 |
    | character_set_connection | utf8 |
    | character_set_database | utf8 |
    | character_set_filesystem | binary |
    | character_set_results | utf8 |
    | character_set_server | utf8 |
    | character_set_system | utf8 |
    | collation_connection | utf8_unicode_ci |
    | collation_database | utf8_unicode_ci |
    | collation_server | utf8_unicode_ci |
    +--------------------------+-----------------+

    如果是以下内容需要在/etc/my.cnf

    +--------------------------+--------------------+
    | Variable_name | Value |
    +--------------------------+--------------------+
    | character_set_client | utf8mb4 |
    | character_set_connection | utf8mb4 |
    | character_set_database | utf8mb4 |
    | character_set_filesystem | binary |
    | character_set_results | utf8mb4 |
    | character_set_server | utf8mb4 |
    | character_set_system | utf8 |
    | collation_connection | utf8mb4_unicode_ci |
    | collation_database | utf8mb4_unicode_ci |
    | collation_server | utf8mb4_unicode_ci |
    +--------------------------+--------------------+

    character_set_server=utf8
    collation-server=utf8_unicode_ci
    init_connect='SET NAMES utf8'
    skip-character-set-client-handshake=true

    2、创建库是设置编码(utf8)格式

    CREATE DATABASE chao_test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

    CREATE DATABASE dataexa_insight DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    3、创建用户

    insert into mysql.user(host,user,password) vlues('192.168.203.66','chao',password('123456'));

    4、用户授权
    1)grant select, insert on test2.* to 'chao'@'192.168.203.66' identified by '123456';
    2)grant select, insert on test2.* to 'chao'@'192.168.203.66' identified by '123456';
    3)授权时也可以创建用户
    grant select, insert on test2.* to 'chaochao'@'192.168.203.66' identified by '123456';

    5、更改密码
    update mysql.user set password=password('123') where user='chaochao' and host='192.168.203.66';

    flush privileges;

    6、删除用户
    drop user 'chaochao'@'192.168.203.66';

    flush privileges;

    7、drop 表 和 库

    8、回收权限

  • 相关阅读:
    git archive
    查看库的详细版本号,
    locks
    jquery中的DOM操作集锦
    Eclipse调试Bug的七种常用技巧
    eclipse如何修改dynamic web module version
    Eclipse导入到web项目没有run on server
    深入理解JavaScript系列
    10个好用的JQuery代码片段收集
    实现table样式的设定
  • 原文地址:https://www.cnblogs.com/sxgaofeng/p/12307266.html
Copyright © 2020-2023  润新知