Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql连接会不会出现假连接 #175

Open
geek199019 opened this issue Jul 16, 2021 · 1 comment
Open

mysql连接会不会出现假连接 #175

geek199019 opened this issue Jul 16, 2021 · 1 comment

Comments

@geek199019
Copy link

if (mysql_real_connect(_pstMql, _dbConf._host.c_str(), _dbConf._user.c_str(), _dbConf._password.c_str(), _dbConf.database.c
str(), _dbConf._port, NULL, _dbConf._flag) == NULL) 这个可能会出现假连接吗 改为 if (_pstMql = mysql_real_connect(_pstMql, _dbConf._host.c_str(), _dbConf._user.c_str(), _dbConf._password.c_str(), _dbConf.database.c
str(), _dbConf._port, NULL, _dbConf._flag) == NULL) 这样会不会好点,在执行查询的时候偶尔会在mysql_real_query()报段错误,具体不知道是什么原因

@ruanshudong
Copy link
Contributor

没看懂有啥区别?你是不是多线程在操作, 这个类不是线程安全的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants