限制普通用户在huago_production_tool数据库上的权限
This commit is contained in:
parent
c6a0a02c10
commit
4f568b20ab
|
@ -312,7 +312,7 @@ HGResult HGPdtToolDbUserMgrImpl::CreateUser(const HGChar* userName, const HGChar
|
|||
return HGBASE_ERR_FAIL;
|
||||
}
|
||||
|
||||
sprintf(sqlCmd, "grant all privileges on huago_production_tool.* to '%s'@'%%';", userName);
|
||||
sprintf(sqlCmd, "grant create, insert, select, update on huago_production_tool.* to '%s'@'%%';", userName);
|
||||
ret = mysql_query(m_sql, sqlCmd);
|
||||
assert(0 == ret);
|
||||
sprintf(sqlCmd, "grant select on mysql.user to '%s'@'%%';", userName);
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
int main()
|
||||
{
|
||||
HGPdtToolDbUserMgr userMgr = NULL;
|
||||
HGPdtToolDb_CreateUserMgr("127.0.0.1", 3306, "huago", "123456", &userMgr);
|
||||
HGPdtToolDb_CreateUserMgr("127.0.0.1", 3306, "root", "123456", &userMgr);
|
||||
if (NULL != userMgr)
|
||||
{
|
||||
HGChar* name[256];
|
||||
HGUInt count;
|
||||
HGPdtToolDb_GetUserList(userMgr, name, 256, &count);
|
||||
|
||||
//HGPdtToolDb_DestroyUser(userMgr, "huago");
|
||||
HGPdtToolDb_DestroyUser(userMgr, "huago");
|
||||
|
||||
//HGPdtToolDb_CreateUser(userMgr, "huago", "123456");
|
||||
HGPdtToolDb_ModifyPassword(userMgr, "123456", "huago");
|
||||
HGPdtToolDb_CreateUser(userMgr, "huago", "123456");
|
||||
//HGPdtToolDb_ModifyPassword(userMgr, "123456", "huago");
|
||||
//HGPdtToolDb_SetPassword(userMgr, "huago", "qqq");
|
||||
|
||||
HGPdtToolDbDevice device = NULL;
|
||||
|
|
Loading…
Reference in New Issue