Answer the question
In order to leave comments, you need to log in
How to connect MySQL to c++ vs2013?
I registered all the necessary paths for connecting mqsql in the project, everything seems to be connected, registered, but errors are pouring in from which I can’t get rid of.
Here is the code itself:
#include "db_forms.h"
#include <QString>
#include <QLineEdit>
#include <QMessageBox>
#include <stdint.h>
#include <C:\Program Files\MySQL\MySQL Server 5.7\include\mysql.h>
db_forms::db_forms(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
MYSQL mysql;
MYSQL_RES *res;
MYSQL_ROW row;
if (!(mysql_real_connect(&mysql, "localhost", "user", "root", "db_forms", 3306, NULL, 0)))
{
QString error;
error = mysql_error(&mysql);
QMessageBox::information(NULL, "Error connecting to server", error );
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question