Install MySQL Database on Windows

1- Summary versions of MySQL

There are 2 versions of MySQL:
  • MySQL Cummunity
  • MySQL Enterprise Edition
MySQL Cummunity: The free version. (We will install this version).
MySQL Enterprise Edition: A commercial version.

2- Download MySQL

We will download and use the free MySQL package:
  • MySQL Community Server
MySQL Community, after being downloaded and installed fully, includes parts as illustrated in the following image.
There are two most important things:
  1. MySQL Server
  2. MySQL Workbench   (A visual tool to learn and work with MySQL)
To download MySQL Community, goto:
Download results:

3- Install MySQL Community

Select all, including the example Database (For study purposes).
At this point the installer notifies you that your computer does not have the necessary libraries installed. So if you click "Next" to continue the installation may be faulty during installation.
Click on the required libraries and click the "Execute" button.
At this time, all necessary libraries have been installed on your computer. Some libraries you may not need to use such as Connector/Python, you can skip it or manually install if you want. OK, click Next to continue to install MySQL:
The installer displays a list of packages to be installed.
The installer continues to MySQL Server configuration section.
Continue configuration for examples database:
Enter the password and click Check to test the connection with MySQL.
Click Finish to complete the installation.

4- Configure MySQL

The connection with MySQL from another computer can be blocked. You need to configure it so that other computer can connect to your MySQL.
Our objective is to assign the authority of accessing to MySQL to a user from any IP address.

-- Syntax:
GRANT ALL ON *.* to myuser@'%' IDENTIFIED BY 'mypassword';

-- Note: The 'root' user is available after installing MySQL.
GRANT ALL ON *.* to root@'%' IDENTIFIED BY '12345';
The grant success.

5- Using MySQL Workbench

Open MySQL Workbench:
MySQL Workbench with several example database:
We create a database with the name: mytestdb.
Setup this SCHEMA as default to work.
Next create a table, and insert one row into it.

-- Create table.
Create table My_Table (ID int(11), Name Char(64)) ;

-- Insert one row.
Insert into My_Table (id,name)
values (1, 'Tom Cat');

6- SQL Tutorial for Beginners with MySQL

Next, you can learn MySQL at: