Database Connection in C++ - MySQL or MariaDB

Опубликовано: 09 Май 2026
на канале: Steve's teacher
57,109
690

Time to connect to a database using pure C++, no codeblocks, no special IDEs, no QT, just C++ and MySQL.

NOTE: You need to have libmysqlclient-dev installed if you're using MySQL (linux)

Running the code: g++ connectdb.cpp -o output -L/usr/include/mariadb/mysql -lmariadbclient
Note: Remember to modify if you don't use MariaDB

Need the source code? Click here: https://github.com/WeebNetsu/database...

Timestams:
00:00 - Intro
00:28 - Rant
01:24 - Example Program
02:14 - What You Need
03:06 - Creating the files
04:00 - Template Code
05:25 - Coding Everything
16:30 - The main() Code
24:33 - Running the Code (Info)
26:49 - Fixing Errors
27:18 - Running the Code
27:33 - Outro

For more programming videos, feel free to subscribe to my 2nd channel:    / @programmervibe  

Python Programming Tutorials:    • (Old) Python Programming Tutorials  
Japanese Lessons:    • Japanese Lessons  
Delphi Programming Tutorials:    • Delphi Programming (Tutorial)  
How-to videos:    • How to  
Crash Courses:    • Crash Courses  

The stack: https://stackoverflow.com/questions/6...

Thank you, thank you, thank you, thank you, thank you: https://www.codingfriends.com/index.p...

Group Chats:
Weeb Chat: https://t.me/weeb_haven
Programmer Haven: https://t.me/programmer_haven

You can contact me on:
Email: [email protected]
Discord:   / discord  
Kitsu: https://kitsu.io/users/Netsu
Twitter: @stevesteacherYT or click here: https://twitter.com/stevesteacherYT?s=09

Any suggestions? Leave it in the comment section or contact me somewhere else!

Thank you for watching!