Database Connection in C++ - MySQL or MariaDB

Database Connection in C++ - MySQL or MariaDB

Steve's teacher

3 года назад

47,728 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

The Metro Detroit Virtual Racer
The Metro Detroit Virtual Racer - 04.10.2023 21:42

Very helpful video! I wish he used classes and such bc the way the code looks looks very similar to a code. In other words, I wish he used object-oriented programming principles to connect with the SQL databases since C++ is known for that.

Ответить
Ілля Леонідович Дубровін
Ілля Леонідович Дубровін - 13.09.2023 21:22

Thanks!! Very helpful. Love your voice 💅💅💅

Ответить
J V
J V - 05.06.2023 18:16

MariaDB is a drop-in replacement for MySQL. All code created for MySQL will work on MariaDB.

Ответить
Chi Ee Yeoh
Chi Ee Yeoh - 05.06.2023 10:42

Anyone of you manage to replicate this example on Ubuntu 22 with MySQL?
If not, which Ubuntu releases you use that successfully run this example? Thanks in advance

Ответить
LeadVitamin
LeadVitamin - 17.05.2023 04:54

ACKSHULLY, usr stands for unix system resources.

Ответить
Seth Parker
Seth Parker - 26.02.2023 17:33

Thank you so much for appreciating those of us who also find the codeblox stuff disgusting, and actually going into the code

Ответить
Cavi587
Cavi587 - 01.11.2022 14:25

I don't know why you hate on Code::Blocks so much. Sure, it's a bit dated and there are better alternatives, but at least it's not made by Microsoft. I refuse to use VSC, it's soo slow. CLion is the way to go for C++ in my opinion. But something like Code::Blocks is good for beginners, it's free and light but gives you some more tools than a simple code editor.

Ответить
Colin Maharaj
Colin Maharaj - 08.10.2022 06:05

I did these c++ connection to MySQL using headers, DLLs, no libraries to link to. I did the code to use the DLL in windows.

Ответить
Colin Maharaj
Colin Maharaj - 08.10.2022 06:03

I spent a few weeks connecting to oracle and using their OCI coffee and DLLs and lib.

Ответить
Em Outras Palavras - Marlon Couto Ribeiro
Em Outras Palavras - Marlon Couto Ribeiro - 10.09.2022 04:34

Just notice if you want to run that connection in a loop, instead of exit(1) when something goes wrong, it is better to add <mysqld_error.h> header and show an informative error message with mysql_error() function that takes the MYSQL* connection as a parameter. If you are using Windows and you have to include the MySQL system path to your IDE cpp compile settings . To be precise, include C:/Program Files/MySQL/MySQL Server 8.0/include" and ${the same}/MySQL Server 8.0/lib". Here you may bump into a problem with the libmysql.dll - if you are using a 32 bit compiler and that file is 64 bit you cannot build the project and vice-versa. Either everything is 64 bit or 32 bit. If you have found it difficult, have a look at a more modern and simplified API offered through the MySQL Connector C++ in cleaner C++ (header file: <mysqlx/xdevapi.h>), have a look at their guide and examples on Github

Ответить
myPalabok
myPalabok - 25.06.2022 05:25

maybe if you don't eat your words and speak clearly?

Ответить
zacharia mosete
zacharia mosete - 25.06.2022 03:51

connect_database.c++: In function ‘int main(int, const char**)’:
connect_database.c++:37:28: error: aggregate ‘main(int, const char**)::connection_details sqlDatabase’ has incomplete type and cannot be defined
struct connection_details sqlDatabase;
🤔

Ответить
zacharia mosete
zacharia mosete - 25.06.2022 02:42

well done keep it up

Ответить
lDracarys
lDracarys - 31.05.2022 16:31

how can we insert

Ответить
Andrei Dodu
Andrei Dodu - 19.05.2022 10:47

Hi, I have undefined reference to my sql functions and i did as you. Any help?

Ответить
Russ Sully
Russ Sully - 14.05.2022 06:00

This is only on the local machine correct? How would I go about making users able to log in from other computers?

Ответить
Asada
Asada - 04.05.2022 21:41

how to connect mysql remote access?

Ответить
Mr. Thiccums
Mr. Thiccums - 02.04.2022 18:06

holy shit that microphone is awful

Ответить
kaskej
kaskej - 13.03.2022 14:38

I need something exactly like this, thanks

Ответить
Ragini Bhayana
Ragini Bhayana - 06.03.2022 11:56

i really like this, super thankful. I just think it's better when unnecessary background music isn't included.

Ответить
Slickback
Slickback - 29.01.2022 01:36

Nice one man.
I'm a UK Year 4 Computer Science student, out of the coding languages I've used, C/C++ is the one I've struggled with most, pointers and references confuse me and all the std:: stuff takes time to get used to.
Great video, I've shared it to a few peeps.

Ответить
Zin
Zin - 11.01.2022 20:41

i like how the way he label the part of video hahaha rant

Ответить
Fajar Sidik
Fajar Sidik - 11.01.2022 02:03

How to execute stored procedure in mysql use c++ .

Ответить
scott knestrick
scott knestrick - 19.12.2021 15:16

Thanks! I was getting nowhere with all the changes with MariaDB. Thank You!

Ответить
Joan Vidal
Joan Vidal - 09.11.2021 17:36

good man thanks a lot very informative

Ответить
Dave Paddy
Dave Paddy - 23.10.2021 18:33

Thanks, this was very helpful!

Ответить
TopThis
TopThis - 12.10.2021 21:43

Connecting and accessing the database works on my machine, but when I distribute the program to another machine (with all mysql dlls needed to compile) Its unable to connect to server. Is anyone else facing the same issue?

Ответить
Priyanshu Agrawal
Priyanshu Agrawal - 09.10.2021 22:23

can someone tell me how to store the result in vaiables

Ответить
Peter Alex Namagonya
Peter Alex Namagonya - 24.09.2021 03:25

This has lead to my very first breakthrough in C++ MySQL connection. Thanks a lot

Ответить
Enzycal
Enzycal - 31.07.2021 18:40

I can't thank you enough for this..

Ответить
Michael Mueller
Michael Mueller - 30.07.2021 14:22

Works great. For MySQL + Using Ubuntu 20.04: I had to 'sudo apt-get install libmysqlclient-dev' because I had no 'usr/include/mysql...'

Ответить
Yenosibina Makanjuola
Yenosibina Makanjuola - 10.06.2021 06:56

Please how can I do this on a mac

Ответить
Śmiejący się kanał
Śmiejący się kanał - 05.06.2021 01:27

Just use SQLite with sqlite_modern_cpp

Ответить
Anselme Thaïna
Anselme Thaïna - 10.05.2021 10:17

THANKS YOU VERY MUCH, IT WORKS !

Ответить
Pablo Valgañón
Pablo Valgañón - 08.05.2021 21:59

On windows I had a problem linking with the mysqlserver.lib library, it threw a lot of errors because apparently it is compiled with something incompatible with mingw.

I have no idea how it's working, but the way I solved it was by linking not to mysqlserver, but to the mysql library instead. Then, when running the program, it required to be dynamically linked to libmysql.dll, so I copied it to the directory of my executable and now it works fine apparently.

Is it just fine to link to mysql instead of mysqlserver? Is there a way to get a mingw compatible mysqlserver library anyway?

Ответить
Süha Gürsoy
Süha Gürsoy - 26.04.2021 19:55

Thanks so much!

Ответить
Damian
Damian - 19.04.2021 23:25

Can someone recommend any tutorial about why do we use there so much pointers, because all i can find is that pointer points to the location where this data is stored but i can't understand why do we use it here ?

Ответить
Asad Khan
Asad Khan - 28.03.2021 12:13

I am on a windows computer, and there is no mysql.h file in my include directory. Where can I download this, and other files that are required for this, from?

Ответить
Matt Williams
Matt Williams - 28.03.2021 04:12

Whining about GUI software whilst using vscode, interesting

Ответить
Frik Brits
Frik Brits - 16.01.2021 19:02

I went to Postgress just because MySQL is so very difficult to operate.

Ответить
Yashesvi Raina
Yashesvi Raina - 07.01.2021 12:47

It should work on windows too right? or do i have to download some extra files?

Ответить
Мартин Темелакиев
Мартин Темелакиев - 05.01.2021 22:49

subs += 1

Ответить
herhor67
herhor67 - 27.12.2020 15:40

Lmao, so true. Either codeblocks, or wrong language, or some VS from 10 years ago...

Ответить
Fabrício Dultra
Fabrício Dultra - 22.12.2020 01:29

Thank you so much! I

Ответить
Volo Humnytskiy - Technology & Innovation
Volo Humnytskiy - Technology & Innovation - 19.12.2020 19:00

hi help me to connect SQL to C++ VS on Windows please, I would comment more details soon

Ответить
to cissp
to cissp - 30.11.2020 18:11

multiple definition of `mysql_connection_setup(connection_details)'; obj/Debug/main.o:/home/myname/c++/Learn C++/mysql.cpp:14: first defined here|

Ответить