将创建数据库的工作交给root账户
This commit is contained in:
parent
90b9e70feb
commit
670ea99ac2
|
@ -123,7 +123,21 @@ HGResult HGPdtToolDbUserMgrImpl::Create(const HGChar* host, HGUShort port, const
|
|||
return HGBASE_ERR_FAIL;
|
||||
}
|
||||
|
||||
if (NULL == mysql_real_connect(sql, host, userName, pwd, "huago_production_tool", port, NULL, 0))
|
||||
if (NULL == mysql_real_connect(sql, host, userName, pwd, NULL, port, NULL, 0))
|
||||
{
|
||||
mysql_close(sql);
|
||||
return HGBASE_ERR_FAIL;
|
||||
}
|
||||
|
||||
int ret = mysql_query(sql, "create database if not exists huago_production_tool;");
|
||||
if (0 != ret)
|
||||
{
|
||||
mysql_close(sql);
|
||||
return HGBASE_ERR_FAIL;
|
||||
}
|
||||
|
||||
ret = mysql_select_db(sql, "huago_production_tool");
|
||||
if (0 != ret)
|
||||
{
|
||||
mysql_close(sql);
|
||||
return HGBASE_ERR_FAIL;
|
||||
|
|
Loading…
Reference in New Issue