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

db_mysql.cpp连接数据库异常 #232

Open
loginhel opened this issue Feb 5, 2021 · 4 comments
Open

db_mysql.cpp连接数据库异常 #232

loginhel opened this issue Feb 5, 2021 · 4 comments

Comments

@loginhel
Copy link

loginhel commented Feb 5, 2021

[ERROR] SSL error: Unable to get certificate from '0.0.0.0'.
db_mysql.cpp(669), dbopen: connect mysql error(SSL connection error: Unable to get certificate) db_host=0.0.0.0, db_port=3306, db_unix=null, db_name=acl_test_db, db_user=root, db_pass=root, dbflags=0

注释掉acl/lib_acl_cpp/src/db/db_mysql.cpp的dbopen函数这几行后,运行正常:
659 #if MYSQL_VERSION_ID >= 50500
660 _mysql_options(conn, MYSQL_OPT_RECONNECT, (const void*) &reconnect);
661 #else
662 _mysql_options(conn, MYSQL_OPT_RECONNECT, (const char*) &reconnect);
663 #endif

@zhengshuxin
Copy link
Member

这个选项是用来设置mysql连接断开重连的,请问您直接用 mysql 驱动库设置这个选项会出错吗?

@loginhel
Copy link
Author

loginhel commented Feb 7, 2021

是的,用的ubuntu20.04 apt安装的自带的libmysqlclient.so

libmysqlclient-dev/focal-updates,focal-security,now 8.0.22-0ubuntu0.20.04.3 amd64 [已安装]

@zhengshuxin
Copy link
Member

acl 里的 mysql 模块是动态加载的,可能会与不同版本相关,建议从:https://github.com/acl-dev/third_party 下载相应的 mysql 库试一下。

@loginhel
Copy link
Author

loginhel commented Feb 7, 2021

好的,谢谢。

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