mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现策略配置功能
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
//#include "Spdlogger.h"
|
||||
#include "Logger.h"
|
||||
|
||||
MysqlClient::MysqlClient(MysqlOption option) : option_(option)
|
||||
MysqlClient::MysqlClient(MysqlOption option) : option(option)
|
||||
{
|
||||
conn();
|
||||
}
|
||||
@@ -20,7 +20,7 @@ int MysqlClient::conn()
|
||||
return 0;
|
||||
}
|
||||
mysql_ = mysql_init(nullptr);
|
||||
MYSQL* ret = mysql_real_connect(mysql_, option_.host.c_str(), option_.user.c_str(), option_.password.c_str(), option_.dbname.c_str(), option_.port, NULL, 0);
|
||||
MYSQL* ret = mysql_real_connect(mysql_, option.host.c_str(), option.user.c_str(), option.password.c_str(), option.dbname.c_str(), option.port, NULL, 0);
|
||||
if (ret == NULL)
|
||||
{
|
||||
std::string err = mysql_error(mysql_);
|
||||
|
||||
Reference in New Issue
Block a user