#include <QtCore/QCoreApplication>
#include <cstdio>
#include "mysql.h"
int main(int argc, char *argv[])
{
MYSQL mysql;
if (mysql_init(&mysql)==NULL)
{
printf("Failed to initate MySQL connection");
}
mysql_ssl_set(&mysql, "../../p2pro/src/newcerts/p2pro-application-key.pem", "../../p2pro/src/newcerts/p2pro-application-cert.pem", "../../p2pro/src/newcerts/ca-cert.pem", NULL, "DHE-RSA-AES256-SHA");
if (!mysql_real_connect( &mysql, "192.xxx.xxx.xxx", "test", "xxxxxxxx", "mysql", 3306, NULL, 0) )
{
printf("Failed to connect to MySQL: Error: %s", mysql_error(&mysql) );
}
printf("Logged on to database sucessfully");
mysql_close(&mysql);
return a.exec();
}
#include <QtCore/QCoreApplication>
#include <cstdio>
#include "mysql.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
MYSQL mysql;
if (mysql_init(&mysql)==NULL)
{
printf("Failed to initate MySQL connection");
}
mysql_ssl_set(&mysql, "../../p2pro/src/newcerts/p2pro-application-key.pem", "../../p2pro/src/newcerts/p2pro-application-cert.pem", "../../p2pro/src/newcerts/ca-cert.pem", NULL, "DHE-RSA-AES256-SHA");
if (!mysql_real_connect( &mysql, "192.xxx.xxx.xxx", "test", "xxxxxxxx", "mysql", 3306, NULL, 0) )
{
printf("Failed to connect to MySQL: Error: %s", mysql_error(&mysql) );
}
printf("Logged on to database sucessfully");
mysql_close(&mysql);
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks