Install MySQL on Windows

A free video tutorial from Tim Buchalka's Learn Programming Academy
Professional Programmers and Teachers - 1.24M students
Rating: 4.5 out of 1Instructor rating
53 courses
1,596,668 students
MySQL Installation for Windows

Lecture description

MySQL Installation for Windows.

Learn more from the full course

SQL for Beginners: Learn SQL using MySQL and Database Design

Understand SQL using the MySQL database. Learn Database Design and Data Analysis with Normalization and Relationships

07:51:05 of on-demand video • Updated August 2021

Have a detailed knowledge and understanding of using MySQL, one of the most widely used databases in the world.
Obtained a knowledge of SQL, and MySQL, allows students to apply for jobs in the IT sector.
In-depth knowledge of database design will give students an edge over other applicants.
In this video, we're going to go ahead and install the MySQL database server on a windows machine. So if you're not running windows, move on to the next video or the one after that where I show you how to do the same thing, but from mac or a Linux machine. But if you're using windows, you're in the right place, so let's continue. So the first thing we want to do is go to the website Once we get there, I'm going to click on my SQL downloads. Then want to come over here and click on MySQL on windows. And then we want to click on my SQL installer. Now it's giving you the option here that if you've got an online connection while running the MySQL installer to choose a version, the web version which is much smaller or if you don't have an online connection to use the installer which is the full product. I suggest you just grab the full product because it makes it a little bit easier indeed you can just install it. But depending on which option you want to choose, select that in my case. I'm going to choose the second one I'm just going to start that then I'm just going to talk about something else. And by the way asking whether we want to set up an oracle web account because oracle now own my the MySQL product or login. We're going to click on no thanks, just start my download. So I'll just start that downloading, wait till it starts. And I'm going to actually go back a few times. I just want to show you after I click on the MySQL installer. Option here it actually said MySQL installer is 32-bit, but we'll install both 32 and 64-bit binaries. And in a minute, I'm going to show you when we go through the installation process how to select that. So what you will need to know is whether your windows machine is running a 32 or 64-bit version of windows. And you can generally find that in about in the control panel to see whether which version you're actually running. So let's quickly do that while we're waiting for this to download. I'm going to go into control panel.And you can normally go into the about by searching for about. And ordinarily depending on your version of windows, it'll tell you system type 64-bit operating system. So we're not so much concerned about the processor because it is possible to have a 32-bit version of windows running the operating system with a 64-bit processor. So we actually want to know this bit here the 64-bit operating system. So you'll need to know whether you're running the 32 or 64-bit version. So you saw how I checked that information on windows 10. If you're running an older version of windows, you can generally find that in the system part of control panel. There'll be a screen similar to this where you can find out which version of windows you're running a 32 or a 64-bit edition. And again, we'll need that when we get to the stage of installing MySQL. I'm going to pause the video now we'll come back once it's fully downloaded and continue the installation. Okay, so we're back and we can see that the installation has completed. So now we need to open the file that we've downloaded, so I'm just going to select open here. Obviously, you'll never get to the folder if your browser doesn't give you the option to open it from there like I've just done, and that's going to start the installer. I'll give that a moment, click on yes. If it pops up to say that to allow this app to make changes to your machine, the installation wouldn't proceed. It may pop up again and ask you to allow this app to make changes. In my case, it did pop up that twice. And then eventually, you'll get to the license agreement. So I'm going to click on I accept the license terms and click on next. And now we get this option where we can choose the setup type. There are various radio buttons here to the left. And to the right, it gives you a description of what it's actually going to install. So you can see the first option installs this is MySQL server and the tools required for application development. You've got a server only. It does just that it installs only the SQL server. We've got a client option. We've got a full option. But the option we're going to select is the custom option so that we're installing only the things that we need for this course. I'm going to click on custom, and I'm going to click on next. Once we've done that, we get this screen here where you can see to the left-hand side there's a list of available products and the right-hand side shows a list of the products that are to be installed. Currently, that's empty because we haven't selected anything yet. So I'm going to come over here first and click on the plus for to the left of my sequel service, and keep clicking on the plus click it on again. And eventually, we get the option. And I mentioned on the previous screen that the installer will install both the 32 and 64-bit versions. In fact you can see there that it does say that. So you can see that both versions are available.So if I go back to MySQL again. You want to install only the version that's appropriate for your operating system. And again, if you recall we went through to determine which type of operating system, whether it's a 62 or a 34-bit version for your computer. In my case, mine is 64-bit, so I'm going to select the X-64 and click on the arrow to move it across to the right-hand side. So that's now going to be installed. The next thing we want to do is come over here to applications, click on the plus again. We want to select my SQL workbench, click on the plus and click on the plus again to open the version. And we can see there that there's also a 64-bit and a 32-bit version. So I'm going to select the 64-bit again and move that over. And by the way the version numbers may change. Depending on when you're watching this video, it might be a later version, but the principle is still the same, just select the relevant version and select the 64-bit or 32-bit version. So at this point now we've selected the only two products we need, so I'm going to click on next, and I'm going to click on execute. And that's going to start the installation of both those products onto this computer. And once that's finished, we need to go through a configuration step to set up user names and so on and so forth. So I'll pause the video, we'll come back once this is complete. Okay. So it's now finished installation. I'm going to click on next. The next it's telling us that it needs to go through and configure the product. So I'm going to click on next and that will bring up the configuration options. And we've got a configuration type here where we can select various different options, but we're going to leave the default of development machine since that's exactly what we're doing here we're using is developers. Now in terms of the port, I'm going to leave it on the default number. It needs to be a unique port number. That's not used anywhere else or it's not used for another application on this computer. So 3306 will be fine for my computer. So normally, that will work for your computer as well. Rest of the defaults are okay. You don't need to change anything else there, click on next. Next it's asking is for what the root password is. Now the root account is created automatically by MySQL and is a logon that is the most powerful user in the system. And generally speaking, it's good to use that username and password very sparingly when you really need to do some sort of super administrative tasks. So what we're going to do is assign a password for it which we need to do, but then we're going to create a new user that we're going to be using for our day-to-day use of MySQL. So you want to enter a password that is hard to guess and is quite secure. So I'm going to put in a password and tells me that the strength is medium. So you might want to work on that and create a longer password, so it is very secure and a strong password but to medium is probably a reasonable choice there. So the next thing we need to do is click on add user. We're going to create a user, as I mentioned, that we're going to be using to use in this course.So type in the name of the user. I'm going to call this one dev user, but you can call it literally whatever you like. In terms of the host, I'm going to change that to local host importantly, so that ensures that it only it can only be used locally which is appropriate we only want to be using this username locally. We don't want access from any external source. We're going to leave the DB admin and that's generally the default. There's other options you can choose here, but I'm not going to change any of that I'm going to leave it on admin for now. And we also need to enter a password for this. I do suggest you make it different to the root user, and we'll need to remember that because we are going to be using that in this course. So I'm going to enter it. In this case you, can see I've got a strong password. So probably I should have done that the other way around and I made the root pass with the really strong one. But in any event, you can change that later if need be, but I'm going to accept that as the default. And you can see down the bottom now that we've got a MySQL username set up as well. So now we're done with that and click on next. And it's now wanting to know by some configuration and whether we want to set this up as a service to run on windows. So we're going to accept all the defaults to that and click on next. Now the plug-ins and extensions screen has popped up as you can see here. This is related to a no SQL based development, which we're not working on using in this course. So we're going to accept all the defaults and click on next. And then we're going to click on execute. It's going to start the process of configuring MySQL on this computer. So I'll pause now. Well actually, I was going to pause, but you can see it's already finished, that was fairly quick. So I'm going to click on finish now. Click on next, and you can see we're now done. And leave the checkbox on start MySQL workbench after setup. And that's because we want to run that just to confirm the installation is okay. So click on finish. I'm going to close the browser down. Now what we want to do is before we actually check that is you want to go into services on this computer just to make sure the service has been installed successfully. I'm going to click on the start button, and click on settings. And I'm going to do a search for services. So just go to where you normally configure services. Now sometimes depending on the version of windows to get to where you've got to you might actually have to do it a different way. You might have to go into control panel administrative tools and click services. But in any event you want to get there. And once you've done that, you want to scroll on down here until we get to MySQL and it's usually in alphabetical order. And there's MySQL. And you can see in this case, it's actually running automatic. That's a good sign. The fact that it's running tells us that the MySQL service has been successfully installed and it's actually running. And what I'll do now just quickly show you. You can actually override this if your computer is low on resources. You haven't got a lot of memory, you can change this. So instead of it starting automatically every time your computer starts, you can right click that and go into properties and you could for example make that manual and click on okay. And what that would mean is that it won't start automatically each time you turn the computer on. So you could actually start the computer and if you decide you're doing some development in this course you could just come over to here go into services and click on start and that would start for that particular session. In my case, I'm happy to have this run automatically. I've got enough resources, so I'm going to click on automatic. So that every time I reboot the computer, MySQL is available for me. So we've confirmed that's running okay, so close that down. And actually just quickly and back into services again. The other thing was it for some reason. You probably would figure this out anyway, but for some reason it wasn't running, you could just click on start to make sure that it was started or stop and start or there's a restart option as well. You could try one of those if you had some difficulty starting it up for whatever reason. But generally, the installation should work for most people. All right. Getting back now to the MySQL workbench that started automatically once my sequel was installed. I want to start by clicking on this local instance, so click on that and that brings up this little screen it's asking for the root username. So I'm going to type in that root username that I signed earlier in the video. And I'm going to choose not to save it. You could choose save the password if you like, but for security reasons I prefer not to do that, click on okay. And this has opened up, which is a good sign that we got the password correct. If we come over here and click on service status, that gives us a bit of an overview the fact that it's actually running as you can see here, number of connections well all of this is -- we have actually got some connections because of the installation and a bit of traffic and all these efficiency things and bits and pieces. But obviously, there won't be a lot happening at the moment and that's because we haven't really started using it yet. But bearing in mind that we are actually opening the database because we've used MySQL to actually do that in case you're wondering where the connections are actually coming from. You can come over here and click on users and privileges, and that will confirm the list of users so you can see there that we had the root account which was automatically created for us and also the dev user account that we created. All right. So click on view now from the view menu and select home. We'll go back to where we were. Now we're going to come over here and click on this little wrench to the right of the plus sign which is for managing connections. That should open up this little screen here so you can see. And to the left there, we've got this managed server connections. So I'm going to click on this local instance MySQL 57, and we're going to click on test connection. It's going to want that password, that root password again. So I'm going to type that in and you can see that we've successfully made the MySQL connection. So that tells us that my sequel is working correctly, and we're able to connect to the database and that obviously is going to serve as well in a future video when we start using MySQL. So that's okay. I'm going to click on close. All right. Now let's click on the plus. This time we're going to add a new connection. We're going to add a new connection for what we're going to be using in this course. So click on plus. And the connection name, I'm just going to call it development, but you can call it literally whatever you like. And we're going to change the username instead of root, we're going to change that to the username we created which was devuser. So I'm going to click on test connection then I'm going to enter the password rather for this particular username that we've set up. Remembering that this isn't the root user this is the other user. Okay, click on okay, and you can see we made a successful connection so that tells us that the username and password are valid, and we're good to go. So click on okay. Then importantly, click on okay to add that user. And we've now got this second connection configured under the MySQL connections. We're going to be able to use that in the course. So I'm going to finish the video here. Now we're actually done. In the next video, as I mentioned at the start, it's actually a video for mac users. So if you've just installed this on windows and you haven't got a mac and or a Linux machine, you can skip the next one or two videos and move on to the video after that where we actually start working with this database that we've just installed and configured. So I'll see you in that next video.