将创建数据库的工作交给root账户

This commit is contained in:
luoliangyi 2022-12-09 18:17:18 +08:00
parent 90b9e70feb
commit 670ea99ac2
1 changed files with 15 additions and 1 deletions

View File

@ -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;