标签:table mariadb none mysq 用户 表示 SQ 授权 grant
MySQL-用户管理
MariaDB [(none)]> select Host,User,Password from mysql.user; #查询数据库用户
MariaDB [(none)]> create user "用户名"@"授权方式" identified by "密码"; #创建用户
MariaDB [(none)]> drop user "用户名"@"授权方式"; #删除用户
MariaDB [(none)]> set password for "用户名"@"授权方式" = password("新密码"); #修改密码
MariaDB [(none)]> set password=password("123"); #修改登陆用户的密码
grant privileges on databasename.tablename to "username"@"host"; #授权用户
revoke privileges on database.tablename from "username"@"host" #撤销用户授权
==========================================================================================
privileges: #表示要授予什么权力 all,select,insert,delete,update
databasename.tablename #要授权的数据库.表
"username"@"host" #表示授权给哪个用户。
==========================================================================================
标签:table mariadb none mysq 用户 表示 SQ 授权 grant
原文地址:https://www.cnblogs.com/LyShark/p/9069422.html