3 C
Texas

How to install MySQL in Windows 10

Hello, how are you? Today we are going to talk about MySQL. This is a management system for rational databases. This database manager is multithreaded and multi-user, allowing it to be used by several people at the same time. In the same way, it can perform several queries at the same time, which makes it extremely versatile. Additionally, most of the code is written in C/C++ language and the syntax of its use is quite simple, which allows you to create simple or complex databases very easily. Besides, it is also multi-platform, which gives great flexibility to access databases from multiple devices. So in this post, let’s explain how to install MySQL in Windows 10.

Prerequisite

In order to use MySQL correctly, you need to have Microsoft Visual C++ installed. With this intention, go to the following link, and select the executable corresponding to the processor architecture:

Microsoft Visual C++ download page
Microsoft Visual C++ download page

Once the download is finished, you only have to double-click on the file and install it normally. After this, we will be able to install MySQL in Windows 10.

Download MySQL for Windows.

The first thing we have to do is to download the MySQL installer for windows:

MySQL website
MySQL website

Configure MySQL

- Advertisement -

Wait while the file is downloading, and finally double-click on it to run it. Immediately the wizard will ask what type of installation you want to run. For the purposes of this tutorial please choose Custom installation:

Choose the type of MySQL installation.
Choose the type of MySQL installation.

In the next window choose the components to install:

  • MySQL server
  • Workbench
  • Shell
  • Documentation
  • Samples and Examples
Select the components needed to run MySQL
Select the components needed to run MySQL

On the next screen, press Execute to install the selected components. After installing all components, press Next to continue.

Next, the wizard offers the configuration of the installation according to the needs of the user. In other words, you can continue the installation for a stand-alone server or for a cluster. In this case, select the installation for a standalone server.

Select the installation type
Select the installation type

Now select the network type and characteristics. Set the configuration as Development Computer and leave the other options as they are.

Set the type and networking
Set the type and networking

In the next window choose the type of authentication you want to set. While the first option offers greater strength, I recommend that you use the legacy authentication method. Consequently, this will allow for greater flexibility of use:

Choose the type of authentication
Choose the type of authentication

In the next window set the password. It is highly recommended assigning a strong value, especially for the root user. In the same way, you can add as many users as you want.

Set the password. Adds users.
Set the password. Adds users.

Now you have the possibility to establish MySQL as a windows service for any user or a specific user. Besides, you can select that the server will start in conjunction with Windows.

Set MySQL server as a service.
Set MySQL server as a service.

In the next window press Execute to confirm the configuration:

Apply the configuration
Apply the configuration

Configure samples and examples

Now configure the samples and examples:

Product configuration
Product configuration

It then connects to the server. With this intention, enter the password we created earlier. If all goes well, then you will see a successful connection message highlighted in green.

Connects to server
Connects to server

Then check the configuration and press finish.

Apply the configuration
Apply the configuration

Next, we will see that the configuration of the features has been completed.

Completed product configuration
Completed product configuration

At the end of the installation and configuration, the wizard offers the option to launch the installed MySQL components. But for now, we’ll just finish the process.

MySQL successfully installed
MySQL successfully installed

Adding environment variable

To ensure the correct operation of MySQL from the command line, it is necessary to add the appropriate environment variable. This way we can launch MySQL from any Command Prompt. Otherwise, you would have to go manually to the installation address of the program. In addition, The variables you have to edit is the one corresponding to the Path value. With this in mind, add the following address: C:\Program Files\MySQL\MySQL Server 8.0\bin If you want to know how to edit environment variables, please check here.

Adding environment variable.
Adding environment variable.

Testing MySQL from Command Prompt.

Next, Let’s check that the variable has been added correctly. This way, we’ll launch any MySQL command. With this in mind, we have to do is open a CMD. In this case, press Win+R combination and type CMD

Run a CMD
Run a CMD

Now type the following command:

mysql --version
Showing the version of MySQL in the CMD
Showing the version of MySQL in the CMD

Connecting to MySQL command prompt mode.

What we are going to do is summon the root user, adding the corresponding password. With this intention, type the following command into the CMD:

 mysql -u root -p 
Connecting to MySQL database via terminal
Connecting to MySQL database via terminal

Now let’s show the databases present. Please note that even though we didn’t load any, we downloaded some samples at the beginning of the installation. With this in mind, you just have to run the following command:

show databases;
Showing the database.
Showing the database.

Starting MySQL graphical mode.

To start MySQL graphically, just launch the Workbench. We do this by typing it in the Windows search engine:

Launching MySQL Workbench
Launching MySQL Workbench

Next, add the password to connect to the service:

Enter the password.
Enter the password.

The MySQL Workbench initial window will be launched immediately.

MySQL Workbench running on Windows 10
MySQL Workbench running on Windows 10

Conclusion

Finally, we have seen how to install MySQL in Windows 10. From now on you can take advantage of all the benefits of this powerful database. Likewise, following these steps, I have no doubt that you can install it and launch it without any problem. This is all for now, see you next time.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article