Downloading the Software
Obtain MySQL 5.7.29 64-bit from the official MySQL archives or a trusted mirror. This guide uses the portable (zip) distribution which does not require installation wizard.
Configuration Steps
1. Extracting the Archive
Extract the downloaded zip file to your preferred installation directory. For example: E:\Database\mysql-5.7.29-winx64
2. Environment Variables
Add the MySQL bin directory to the system PATH:
- Open System Properties → Advanced → Environment Variables
- Edit the PATH variable and append:
E:\Database\mysql-5.7.29-winx64\bin - Confirm all dialogs
3. Cerating Required Files
Create a data directory and configuration file in the MySQL root folder:
E:\Database\mysql-5.7.29-winx64\data
Create my.ini in the MySQL root directory with the following content:
[mysqld]
port=3307
basedir=E:\Database\mysql-5.7.29-winx64
datadir=E:\Database\mysql-5.7.29-winx64\data
max_connections=150
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
skip-grant-tables
[mysql]
default-character-set=utf8
Note: The port is changed to 3307 to avoid conflicts with existing MySQL instances. Adjust paths according to your actual installation location.
Service Installation
1. Install MySQL Service
Open Command Prompt as Administrator and navigate to the bin directory:
cd /d E:\Database\mysql-5.7.29-winx64\bin
Install the Windows service:
mysqld -install MySQL57
2. Initialize Database
mysqld --initialize
This creates the data directory structure and generates a temporary root password.
3. Start the Service
net start MySQL57
4. Initial Login
Connect to MySQL without a password (due to skip-grant-tables):
mysql -u root -p
Press Enter when prompted for password.
5. Set Root Password
Once connected, execute:
USE mysql;
UPDATE user SET authentication_string=PASSWORD("SecureP@ss123") WHERE User='root';
FLUSH PRIVILEGES;
6. Restart with Security Enabled
Stop the service:
net stop MySQL57
Remove the skip-grant-tables line from my.ini, then restart:
net start MySQL57
7. Verify Installation
Connect with the new password:
mysql -u root -p
Enter SecureP@ss123 when prompted. Verify access:
SHOW databases;
If the database list displays correctly, the installation is complete.