MySQL Installation and Setup for C++ Development on Visual Studio

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right hi everybody today I'm going to show you how I managed to successfully install and set up MySQL in such a way that I could write C++ application on my computer yep so this is probably you've probably come across this before on YouTube so what I aim to do here is to do a more updated version of it so here's hit by the way this is a she serves the system specs so system specs behind this tutorial is that I'm using Windows 10 professional this is based on a 64 bits machine one of the grouped tutorials I came across previously on YouTube says that I can't that this will not work on a 32 or 64 bits but only a 32 bit but somehow I managed to get it working and I'm going to show you how I managed to do it and then I am using Visual Studio community 2017 I'm not using code blocks so yeah so I guess most of us are using PS 2017 now if it matters I'm not sure if it just the dotnet framework version with this tutorial is a four point seven point zero three zero five six the committee the my sequel community server and connector for C++ version in this case is its point zero point one one all right so this tutorials made on 20th July 2018 alright so the steps that we're going to take here first we need to download and install the MySQL installer then what we're gonna do is that we're going to install my sequel community server as well as connect connect to C++ we're going to update the relevant directories in Visual Studio community 2017 got a cold build and run and I'm gonna have to I'm gonna prove it to you that this would work note that there is no need in my case there I had no need of using boost boost is a pretty good set of libraries I I do but it's huge and I've installed it before it's it's massive it takes a lot of time and just have a very sick - have a simple C++ application that runs SQL statements on my sequel does not need the boost library so yep if you need a boost library is going to look up other tutorials I'm not going to cover it here alright so without further ado we let's download my sequel installer and I really have it here on my web browser download the latest GA really release in this case I'm going to download a smaller file the my sequel installer web community version this particular MSI will require you to be constantly connected to the Internet but you're going to save a lot more time and Hardy space and I'm gonna show it to you here so I'm gonna click download I'm going to download it they can I can completely ignore the login and sign up go straight to no thanks just start my download let it run okay a little bit more time using a faster PC and a faster internet connection of course speed will be different from what you see yeah okay so I'm running the msi right - now we're going to we're going to follow the steps in there for the sake of this demo and I am just going to use some very simple a very simple setup in your case if you might have more unique requirements please do the necessary changes but my recommendation is that if you are doing this setup for the first time and you are not sure whether you are going to do it successfully I recommend just do it just doing it once and in this step and this demos is also run on a virtual machine so if you are using a virtual machine anyway yeah just remember to use your snapshots ok so here for my case I'm being asked upgrade my MySQL installer and I shall do it here in your case it might be required it might not be I don't know okay I'm gonna let it run it's not gonna take too long fast forward if you want but we're about done okay so we are almost there alright so what you're going to see now is the product catalog here's the License Agreement read it if you will and if you do or do not just click on I accept the license terms anyway click on next you'll be given a choice of setup type in my case I chose and I will choose custom click on next alright what's going to be covered here in the tutorial I am only going to need to install my sequel server note that is eight point zero point 1 1 and this is the 64-bit version I've read from somewhere on the internet that my sequel server is now only available on 64 bits and no longer in 32 bits I'm not sure how true that is but I'm going to take that as true anyway I'm using a 64 bit machine in this case I'm going to install my sequel connector for c plus plus so okay I'm gonna first I'm going to click on sorry back to this my sequel server I'm going to click the arrow here that will be me the product I'm going to install the next will be connector C++ and again is to in so basically the package options for server I'm going to leave it alone and for connect to C++ this only one so once I'm done with this I click Next right and it's not downloaded yet and I'm just going to click execute this might take a while so feel free to fast forward if you want to again if you're using a much faster internet connection then the download the download timing will be a lot faster it's a part of me if you hear any construction noise in the background all right I'm just going to let this run it's not gonna take too long anyway you know connector C++ is already downloaded installing that right now almost done now installing server a little bit slower you do okay so when it's done click on next okay so the first thing that we will be configuring is the my sequel server click on next in my case I chose that alone as my sequel server and I left this alone as as development computer I left the ports at the defaults at three 3:06 click on next use a strong password click on next for this demo I'm just gonna use password as password or like all creativity when you're going production make sure just be sure to change the password to something else more secure I am NOT going to add a new a new user here in this tutorial and if I leave this blank then to access your database you just use root as a user ROG alright so click on next I'm leaving these these alone click on next and click on execute if it's some time it's not gonna take a long while at all while the configuration is being applied now so you notice that if you use my sequel installer setup is probably going to be a lot quicker and easier so yeah kudos to Oracle for this and yep just wait and it's done so once it's done click on finish you'll be shown this again and just click on next and actually you're done you can copy the lock to the clipboard if you like I'm not going to do that and I'm gonna click finish ok so now we are done here the next thing that you want to do is you've already done step one and step two the next thing we want to do is to update the relevant include and lit directories into in my case Visual Studio community 2017 so I've already gotten a project set up in this case this is a Windows console application I've got this code already prepared and I might make this available just look out for the link in the description and yeah I won't be going through all all of this code so first things first it's time to set up the directories if you do not set up the directories you'll notice that some of the there will be errors in the code there will be classes that are not defined and there will be include files that are not available as well so we're gonna have to fix this okay so here's up here's what you got to do you right click on your project go to properties okay in this case I go to my configuration manager first you have to change the solution configuration to release for some reasons I'm sure this is explained somewhere if you're going to run my sequel applications it does not work on debug it can it would all it will only work on release so I'm gonna change this to release I'm going to change this to x64 apparently it does not seem to work on x86 anymore okay so make sure that release and x64 is selected the employee is not going to work here anyway so just ignore that click on close alright so now you're back into in your property pages under configuration I guess best practice select all configurations make sure that it is indeed x64 the first thing you want to do is that you want to go to under configuration properties go to see slash C++ click on general you want it to include the include directories click on the arrow here drop down click on edit all right you're gonna have to put in the include directories here in my case I already have them sorted out here if you install if you installed my sequel based on the defaults settings that default folders this should likely be your path so let's include a connector plus C++ include path directory first okay and it has to be in this order connect to C++ first followed by my sequel server / include okay at any time in your projects if you require to use boost just make sure that you put your boost folder right after both connector and server include folder so when you're done click OK the next thing is under is go-to linker under general that's where you have to define the folder for your life for your libraries do the same click on edit and in my case the connector c++ lip folder it doesn't stop just as just lip it has you have to put /opt why I don't know I'm sure there's a reason but I just don't know then the next one the same order my sequel server lip folder ok so when you're done click OK ok so now that you've told Visual Studio where to look for the additional library directories the next thing is to go to input to that visual tell me her studio which lip file you need okay so in this case what's needed for this project my sequel CPP con dot lip and lit my sequel dot nib so you just need this to click okay make sure that they are here and that should be its I'm gonna click OK now let's see what the error is what the errors disappear are so it's passing the included files right now and apparently so it seems to be well and good ok so what we're going to want to do next is to code to build and to run to prove that the setup is correct and that you could run my sequel commands on your C++ application but before that what you want to do is that you need to set up a database for testing and fortunately in this case I've really gotten the steps created okay so what you want to go to is my sequel 8.0 command-line clients click on that and remember the password that you keyed in earlier so just in my case it was password you depending on what password you chose during the setup enter and once you're connected into my sequel 8.0 command-line client create a database so in my case I've gotten this once prepared already and there you go so what I've done is that I've created a database called test DB and created a table called test and instead of three lines of data in here so these are the lines of data ID name score and whole set of stuff over here alright so the code back to visual studio 2017 the code that I've created here earlier it's what it basically does is that it will want to first connect to the database and these are the credentials first this is the host this is the user which is routes the passwords which is password the we want to connect to test DB database and so we include that here and we are also going to base this on the default port 3306 what will happen first is that the you will try to attempt to connect and if we successfully connect the database we will run a select statement and from still select statement we will be able to get the data and have them put in an array of called row and we will print this out line by line on to the console and if it fails we will show you the error message and if it does not feel the connection of database feel you will do the same okay so without further ado what we want to do is that we go to debug there's a choice between start debugging which is f5 and the other option is start without debugging which is control at 5:00 so in this case you are going to select the second one because if if you select the first one once the application is done running it will close the console window and we don't want that because we want to see what appears what's what's being displayed by the application all right so let's click on this control f5 and let it build and whoopsie-daisy we have an error but just to let you know that this was anticipated right so what you're looking at here is that a particular DLL file called lib my SQL it has to be present I've not found a better way of doing this except that this particular file has to be in the same folder as your executable so this is what we're going to do here and it does turn out that it's not just this DLL file that's required but also in my case the lip EA why 32 dot DLL and the SSL EA why 32.2 DLL alright so we're gonna have to place these three files respectively into the executable directory so let's go there in my case lick my SQL DLL is in this particular folder it should be the same as for you as well if not then try to locate it and find it so what I'm going to do here is that I'm now in that particular folder I will copy this and I will paste it in from it for my case it is this particular folder this is where the built mmm executable file is stored by visual studio in your case it's likely going to be similar here just accept that the username your name and not same as what you see here alright so copy that DLL from here alright and the next one the next two files as well in my case it is stored in my sequel server slash bin it's probably a smarter way of linking this particular folder on Visual Studio I should have tried to do that first before making this tutorial but I did not so for the interest of time I'm just going to locate where the are copy both files into the executable folder as well okay so when we have the respective DLL files in here it should work now so let's just run this and there you go the application is successful it has connected to the database and it has run the Select Statesman gotten the data out and displayed line by line here on the console so this is how you can set this up especially if you are doing this somewhere along the line of 20th July 2018 yeah and once again I let me just flash back the specs so this might be useful reference to you I will try to make these files all available for you to download please check the description and yes I wish you well in your coding endevours and I wish you success thank you
Info
Channel: Tenor Games
Views: 41,741
Rating: 4.8920541 out of 5
Keywords: MySQL, C++, Visual Studio, setup, installation, administration, server, connector, SQL, programming, tutorial, steps, step-by-step, example
Id: yNniOHn9Xe0
Channel Id: undefined
Length: 21min 15sec (1275 seconds)
Published: Fri Jul 20 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.