Connect C Applications to MySQL Database Using Visual Studio 2022 (with Source Code)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this video i will show you how to connect a c application to mysql database using visual studio 2022 so first let's create a c project in this window we can select c plus as the language and then we need to select empty project now let's click on next in the project name i will call it connect c to mysql now let's click on create now the project has been created but it is empty so let's create a new c file so let's make a right click on the project name then add then new item in this window i have to select c file and also i need to modify the extension so i will provide it with the extension.c also i will modify the file name and i will call it main.c now let's click on add now i will paste a simple c application that allows us to connect to the mysql server so in this file we will connect to the mysql server which is available on this local machine so we will connect using the root user and using the root password so this is the password of the root user and then we will create this database if it does not exist but we can see here that we have some errors so to fix them we have to click on project then properties in this window we have to select all configurations and for the platform we have to select x64 then we have to expand cc plus and we have to select general then in the additional include directories we have to add the include folder of mysql so mysql server is installed on the c drive into a folder called program files into a folder called mysql then we have to open this folder it is mysql server 8.0 and we have to select this include folder now let's click on select folder and let's click on ok now let's expand link and let's select general then we have to select additional library directories and we have to add the lib folder of mysql so let's go to c and then let's go to program files then mysql and then mysql server and here we have to select this leap folder let's click on select folder then ok then we have to select input and in the additional dependencies we have to add a new lib file so let's click here and we have to add the leap file so let's go to the folder that contains this sleep file so it is on the c drive into program files into the folder called mysql then we have to open this folder it is mysql server and here we have to open this leap folder now we have to copy the name of this leap file it is mysql client.leap and let's paste it just here now let's click on ok then ok and now we can run this application so here the application has been executed correctly we can close this window and we can open mysql to check that we have created the new database correctly so this is the new database that we have created and to check that it has been created correctly we can open the command prompt then we can connect to the mysql server so hyphen u allows us to provide the username and hyphenp means that we will provide the password and here let's provide the password now we are connected to the mysql server so to see the list of the available databases we can use the following command now let's hit enter and here we can see that this database has been created
Info
Channel: BoostMyTool
Views: 11,558
Rating: undefined out of 5
Keywords:
Id: dY_UfUp0mvo
Channel Id: undefined
Length: 5min 27sec (327 seconds)
Published: Wed Jan 26 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.