zoukankan      html  css  js  c++  java
  • mysql用户管理与权限

    1、设置密码

    set password for 用户名@localhost = password('密码');

    2、取消密码

    set password for 用户名@localhost = password('');

    3、创建账号

    create user admin identified by '123';

    create user 'admin'@'%' identified by '123';

    4、删除账号

    delete from mysql.user where user=用户名;

    drop user 用户名;

    5、授权并建立账号

    grant all privileges on *.* to 用户名@localhost;--创建一个只能本地登录的空密码用户

    grant all privileges on *.* to '用户名'@localhost identified by 密码;--创建一个只能本地登录的用户

    grant all privileges on *.* to '用户名'@'%': --创建一个可以远程登录的用户

    6、收回权限

    revoke all privileges on *.* from '用户名'@'%':

  • 相关阅读:
    多线程之 Final变量 详解
    多线程之 Volatile 变量 详解
    并发安全问题之HashMap
    探索设计模式目录
    MYsql 锁详解 锁 与索引的关系
    JVM GC 相关
    sql 注入 及 in 注入
    00
    03
    02
  • 原文地址:https://www.cnblogs.com/orna/p/8334263.html
Copyright © 2011-2022 走看看