在使用MySQL Connector/C+;SSL连接到AWS RDS期间,用户的访问被拒绝+;
我正在尝试与我的Amazon Web服务RDS Instance建立安全的SSL连接 已创建具有以下权限的用户“ericencrypt”:在使用MySQL Connector/C+;SSL连接到AWS RDS期间,用户的访问被拒绝+;,mysql,amazon-web-services,ssl,qsqldatabase,Mysql,Amazon Web Services,Ssl,Qsqldatabase,我正在尝试与我的Amazon Web服务RDS Instance建立安全的SSL连接 已创建具有以下权限的用户“ericencrypt”: CREATE USER 'ericencrypt'@'%' identified by 'xxxxxx'; GRANT SELECT ON table1.* TO 'ericencrypt'@'%' REQUIRE SSL; MySQL工作台-成功 我可以使用MySQL工作台将SSL CA文件指定为从Amazon下载的rds-combined-CA-bun
CREATE USER 'ericencrypt'@'%' identified by 'xxxxxx';
GRANT SELECT ON table1.* TO 'ericencrypt'@'%' REQUIRE SSL;
MySQL工作台-成功
我可以使用MySQL工作台将SSL CA文件指定为从Amazon下载的rds-combined-CA-bundle.pem连接到我的this
Python-成功
我还能够使用相同的SSL CA组合包pem文件在python上建立SSL连接
C++-失败
问题是当我试图在C++项目中运行这个代码时,我得到了一个
“用户'ericencrypt'@'12.159.10.49'(使用密码:是)的访问被拒绝”错误
MYSQL*conn;
char*server=“pkcloudwest.xxxxxxxxx.us-west-1.rds.amazonaws.com”;
char*user=“ericnotencrypt”;
char*password=“xxxxxx”;
char*database=“table1”;
int端口=0;
conn=mysql_init(NULL);
mysql\u ssl\u集(conn,NULL,NULL,“rds组合ca bundle.pem”,NULL,NULL)
if(!mysql\u real\u connect(连接、服务器、用户、密码、数据库、端口、NULL、0))
qDebug()通过连接获得数据库错误代码表示SSL连接工作正常,除非访问依赖于客户端证书。通过连接获得数据库错误代码表示SSL连接工作正常,除非访问依赖于客户端证书。
MYSQL *conn;
char *server = "pkcloudwest.xxxxxxxxx.us-west-1.rds.amazonaws.com";
char *user = "ericnotencrypt";
char *password = "xxxxxx";
char *database = "table1";
int port = 0;
conn = mysql_init(NULL);
mysql_ssl_set(conn, NULL, NULL, "rds-combined-ca-bundle.pem", NULL, NULL )
if( !mysql_real_connect(conn, server, user, password, database, port, NULL, 0) )
qDebug() << "could not connect: " << mysql_error(conn);
CREATE USER 'ericnotencrypt'@'%' identified by 'xxxxx';
GRANT SELECT ON table1.* TO 'ericnotencrypt'@'%';
MYSQL *conn;
char *server = "pkcloudwest.xxxxxxxxx.us-west-1.rds.amazonaws.com";
char *user = "ericencrypt";
char *password = "xxxxxx";
char *database = "table1";
int port = 0;
conn = mysql_init(NULL);
//mysql_ssl_set(conn, NULL, NULL, "rds-combined-ca-bundle.pem", NULL, NULL )
if( !mysql_real_connect(conn, server, user, password, database, port, NULL, 0) )
qDebug() << "could not connect: " << mysql_error(conn);