Skip to main content

Mysql Server Installation on Windows


Pre Requisites:
  • Microsoft .NET Framework 4.5.2
  • MySQL 8.0 Server requires the Microsoft Visual C++ 2015 Redistributable Package to run on Windows platforms.
  • Users should make sure the package has been installed on the system before installing the server.
  • The package is available at the Microsoft Download Center. 
  •  Additionally, MySQL debug binaries require Visual Studio 2015 to be installed.
URL :
MySQL Downloads @ https://dev.mysql.com/downloads/mysql/
                   @ http://dev.mysql.com/downloads/installer/
Microsoft Visual C++ 2015 @ https://www.microsoft.com/en-us/download/default.aspx


Installing Mysql on windows are two types
          1. Using MySQL Installer
          2. Using MySQL Binaries

Method -1 : Using MySQL Installer
          MySQL installer is the easiest way. MySQL installer provides you with an easy-to-use wizard that helps you to install MySQL with the following components:
          MySQL Server
          All Available Connectors
          MySQL Workbench with Sample Data Models
          MySQL Notifier
          Tools for Excel and Microsoft Visual Studio
          MySQL Sample Databases
          MySQL Documentation


Step 1:
To download latest MySQL installer, go to the following link http://dev.mysql.com/downloads/installer/.
By clicking on the above URL, you will see the below options. Select your operating system (Microsoft Windows) and click on Go to Download Page.
It will redirect you the actual download page for windows Mysql server.,
you can choose the online installation version  mysql-installer-web-community.msi .

If you want to install MySQL offline, you can download the  mysql-installer-community.msi  file.

Step 2: 

It will show you Generally Available (GA) Releases.
Where we can see two different installers, one is a web community installer which comes as a little file and another one is MySQL installer community.
Click the Download button on the second one (mysql-installer-community).


Step 3:

It will ask your MySQL credentials to download the .msi file. If you have your credentials, you can log in or else if you wish to sign up now you can click on the green coloured signup button.
If you are not interested in login or sign up for now, you can directly go and click on No thanks, just start my download option. It will download selected MySQL for you on your local machine.


Step 4:

Go to your downloads folder where you can see the mysql-installer-community file, right click on that file and click Install option.


Step 5:

This window configures the installer, in the middle, it may ask you for permissions to change your computer settings or firewall confirmation, you can accept and then it will take a few seconds to configure the installer.


Step 6:
Read the license agreement and accept the license terms.


Step 7:
This window provides you to set up different types of MySQL installations. You can set up Mysql in 5 different types as provided below. Now I am selecting the Developer Default as I am a developer so that I need all the products which help my development purposes. Click on Next.

Step 8:
Based on your Windows configuration, it may prompt you like “One or more product requirements have not been satisfied”. You can just click on YES.


Step 9:
Click on Execute.


Step 10:
Upon execution of the previous step, the installer grasps all recommended products in place and asking for our approval to execute the product installation process. Click on Execute.


Step 11:
Upon successful execution of all required products, now the MySQL allows us to configure the server settings. Click on Next to configure the server.


Step 12:
This step allows you to configure the server. We can set the server in two different modes. One is a standalone mode, and another one is cluster mode. I don’t want to make it as a cluster because I am installing MySQL for development purpose so that I am selecting Standalone MySQL server and click on Next.


Step 13:
Choose the Development Computer option from Config Type drop-down. You can find the following controls like TCP/IP, Port and X Protocol Port. If you wish to configure your port, you can change here itself and click on Next. For now, I am leaving as its default configuration.

Step 14:
It is prompting you to select the authentication method, leave it as the default recommended method and click on Next.

Step 15:
Here you can set your MySQL root user password. If you wish to create a new user, you can click on Add User button under MySQL user accounts section.


Step 16:
Upon clicking on Add User button, you will get the user details popup which allows you to create a new user account. After creating the user click on Next.


Step 17:
Leave the service details as default and click on Next.


Step 18:
Press Execute to apply the configurations on the previous step.


Step 19:
Upon execution, you can see the below green coloured ticks on every configuration option and finally you will get Finish button.

Click on Finish you got your MySQL on your Windows 10 operating system.


Testing:

Search for MySQL in your taskbar search item. There you can see all MySQL products which we installed and click on MySQL client it will open and ask your root password, give your password and press enter. Then you can see the MySQL prompt like below.

MySQL comes along with some default databases. We can see the databases by giving show databases command.



Installation is completed using windows installer.


Method -2 : Using MySQL Binaries

Step 1: 
Goto download centre https://dev.mysql.com/downloads/  and click for community edition


Step 2:

Download tar file and extract the location where we want to run MySQl binaries in my case i was
extracted in the below location

D:\MongoDB\mysql-5.7.26-win32

Step 3:

Steps to start MYSQL Server (mysql-5.7.15-winx64) for the first time on Windows:
Create a new folder named "data" in MYSQL installation directory (i.e. in the same location as where "bin" directory is located. 
For me it is: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64. This location will vary as per the location where you have extracted the MYSQL zip file)
From here I will use my MYSQL folder location as reference. Go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin 
and execute the command: mysqld --initialize-insecure or mysqld --initialize depending on whether you want the server to generate a random initial password for the 'root'@'localhost' account.
To start the DB, go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin 
and execute mysqld --console You can see the start-up logs being printed.
To connect to DB, go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin 
and execute mysql -u root -p. When prompted, Enter password if it has been set or else just hit "Enter" button to connect


Go to bin under extracted folder and start mysqld using the default port 3306

D:\MySQL\mysql-5.7.26-win32\mysql-5.7.26-win32\bin>mysqld --initialize-insecure

D:\MySQL\mysql-5.7.26-win32\mysql-5.7.26-win32\bin>mysqld --console





Comments

Popular posts from this blog

About MySQL - Database history Support and Versioning

About MySQL: MySQL was created by a Swedish company. David Axmark (left) and Michael "Monty" Widenius,  MySQL AB, founded by David Axmark, Allan Larsson and Michael "Monty" Widenius. Original development of MySQL by Widenius and Axmark began in 1994. The first version of MySQL appeared on 23 May 1995. It was initially created for personal usage from mSQL based on the low-level language ISAM, which the creators considered too slow and inflexible. They created a new SQL interface, while keeping the same API as mSQL. By keeping the API consistent with the mSQL system, many developers were able to use MySQL instead of the (proprietarily licensed) mSQL antecedent. Support: The MySQL server software itself and the client libraries use dual-licensing distribution. They are offered under GPL version 2, or a proprietary license. MySQL AB owns the copyright to the MySQL source code. This means that MySQL AB can distribute MySQL under several different l...

MySQL thread error code of 1032- Translate binlog completely to avoid error

Could not execute Update_rows event on table db.table; Can't find record in 'table', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's   master log mysql-bin.262297, end_log_pos 1983208 As of my knowledge the causing stop of slave SQL thread error code of 1032, due to lack of sync between Master - Slave. In our case, slave got an Update event form master, but that particular record was not available in the slave. (Of course, that was deleted on Master n Slave separately) You would get this error only if the binlog_format is set to ROW_BASED or MIXED mode. So, now check that particular binlog at that position where replication stopped with this error. When you convert the binlog with mysqlbinlog command, you may see some junk characters   where you were expecting some DMLs which caused the error(In our case its an Update statement). So you can use below command to translate binlog completely: mysqlbinlog --base64-output=DECO...

MySQL Architecture -Client Server Architecture

Client/Server Overview The MySQL database system operates using a client/server architecture. The server is a central program that manages database contents, and client programs connect to the server to retrieve or modify the data. MySQL also includes non-client utility programs and scripts. MySQL Server:   This is the mysqld program that manages database and tables. Most users choose binary MySQL distribution that includes a server ready to run with the capabilities they need, but it's also possible to compile MySQL from source. Client Programs:  These are programs that communicate with the server by sending requests to it over a network connection. The server acts on each request and returns a response to the client. For example you can use the mysql client to send queries to the server, and the server returns the query results. A client program can connect locally to a server running on the same machine or remotely to a server running on a different mac...