This guide walks through a manual, ZIP-based installation of MySQL Server 8.0.36 on Windows—bypassing the GUI installer for full control over configuration, service registration, and security settings.
Prerequisites and Environment
- Windows 10/11 (64-bit)
- Administrative privileges required for service installation
- No prior MySQL services or conflicting port usage (default: 3306)
Step-by-Step Installation
1. Download and Extract
Download mysql-8.0.36-winx64.zip from the official MySQL Community Server page. Extract it to a permanent location (e.g., C:\opt\mysql-8.0.36). Avoid paths with spaces or special characters.
2. Configure my.ini
Create my.ini in the root of the extracted directory (e.g., C:\opt\mysql-8.0.36\my.ini) with the following content:
[mysqld]
port = 3306
basedir = C:\\opt\\mysql-8.0.36
datadir = C:\\opt\\mysql-8.0.36\\data
max_connections = 200
max_connect_errors = 10
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
default-storage-engine = InnoDB
default_authentication_plugin = mysql_native_password
[client]
port = 3306
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
Note: The datadir path must point to an existing, empty folder. Create C:\opt\mysql-8.0.36\data manually before proceeding.
3. Initialize Data Directory
Open Command Prompt as Administrator, navigate to bin, then run:
cd C:\opt\mysql-8.0.36\bin
mysqld --initialize --console
A temporary root password will appear in the output (e.g., A temporary password is generated for root@localhost: sF7#xQ!mL9v@). Save it securely—it’s needed for first login.
4. Install and Start the Service
Still in the bin directory, register MySQL as a Windows service:
mysqld --install MySQL8036
Then start it:
net start MySQL8036
Alternatively, use services.msc to locate and start the MySQL8036 service.
5. Secure Initial Access
Log in using the temporary password:
mysql -u root -p
Once authenticated, immediately change the password and disable password expiration:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'SecurePass123!' PASSWORD EXPIRE NEVER;
FLUSH PRIVILEGES;
To verify basic functionality:
SHOW DATABASES;
SELECT VERSION(), @@sql_mode;
Optional: System-Wide Environment Setup
To use mysql, mysqld, and related tools from any terminal:
- Open System Properties → Advanced → Environment Variables
- Under System variables, click New:
- Variable name:
MYSQL_ROOT - Variable value:
C:\opt\mysql-8.0.36
- Edit the
Pathvariable and append:%MYSQL_ROOT%\binTroubleshooting Common Errors
"Install/Remove of the Service Denied!"
This occurs when mysqld --install is run without administrator rights. Always launch Command Prompt or PowerShell as Administrator before registering the service.
"Can't find messagefile" or "Failed to initialize database"
Double-check the basedir and datadir paths in my.ini. Ensure the datadir folder exists and is empty, and that no antivirus software is blocking file creation in that location.
Connection Refused via Client Tools
If Navicat or another GUI client fails to connect:
- Confirm the service is running (
sc query MySQL8036) - Verify
bind-addressis not set to127.0.0.1only (default is fine for local use) - In Navicat, select
MySQLconnection type, host127.0.0.1, port3306, userroot, and your updated password