Deploying MySQL 8.0 on Windows Without an Active Internet Connection
Preparation and File Retrieval
Obtain the distribution package for the latest stable build from the official archive. Alternatively, transfer a verified installer package from another machine to ensure compatibility with your environment.
https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.39-winx64.zip
Extraction Strategy
Decompress the archive immediately rather than running a setup wizard. This method allows greater control over storage locations.
To minimize permission conflicts and maximize disk space, store the application on drives other than C:. A path such as C:\DB_Servers\MySQL8 is recommended.
System Dependencies
Ensure critical runtime libraries are present. Newer hardware often lacks specific Visual C++ redistributables required by newer database engines. Download and execute the appropriate version:
https://download.microsoft.com/download/1/8/0/180fa2ce-506d-4032-aad1-9d7636f85179/vcredist_x64.exe
Environment Configuration
Add the binary directory to the system PATH variable. This enables command-line execution of tools without specifying absolute paths.
- Open System Properties > Environment Variables.
- Edit the Path system variable.
- Append the
binfolder location (e.g.,C:\DB_Servers\MySQL8\bin).
Service Initialization and Registration
Open Command Prompt with administrator privileges. Navigate to the installation bin folder and execute the following sequence:
:: Switch drive if necessary
D:
:: Navigate to binaries
cd "C:\DB_Servers\MySQL8\bin"
:: Initialize data directory securely (unsecured root)
mysqld --initialize-insecure --user=mysql
:: Register as a Windows service
mysqld install MySQL_Service
:: If the service name exists previously, remove it first
sc delete MySQL_Service
Server Configuration
Create a configuration file named my.ini in the root installation directory. Ensure encoding is set to UTF-8 or ANSI depending on OS expectations. Below is a standardized template.
Note: Avoid altering commented-out parameters unless necessary.
[client]
port=3306
socket=/tmp/mysql.sock
[mysql]
no-auto-rehash
[mysqld]
port=3306
basedir=C:\DB_Servers\MySQL8
datadir=C:\DB_Servers\MySQL8\data
# Default Character Set Settings
character-set-server=utf8mb4
collation-server=utf8mb4_0900_ai_ci
# Performance Tuning
default-storage-engine=InnoDB
max_allowed_packet=256M
innodb_log_file_size=2G
innodb_default_row_format=DYNAMIC
# Transaction Isolation
transaction-isolation=READ-COMMITTED
binlog_format=row
# Logging Options
log-output=FILE
log-error=error.log
slow-query-log=1
long_query_time=10
slow_query_log_file=slow-query.log
# Identification
server-id=1
lower_case_table_names=1
# Resource Limits
max_connections=151
table_open_cache=2000
tmp_table_size=16M
thread_cache_size=10
Starting the Database Instance
Launch the service via the graphical interface or command line. Using services.msc, locate MySQL_Service and select Start. Alternatively:
net start MySQL_Service
Initial Security Setup
Upon startup, connect using the default acccount which typically has no password. Execute the following steps within the client session:
Authentication
-- Login prompt will appear blank initially
mysql -u root -p
-- Secure the root account immediately
ALTER USER 'root'@'localhost' IDENTIFIED BY 'ComplexPasswordChangeMe!';
Schema Creation
Set up environments required for common applications, ensuring proper collation settings.
CREATE DATABASE jira_db CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE DATABASE confluence_db CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Network Accessibility Configuration
To permit connections from external hosts, modify user host specifications carefully.
USE mysql;
SELECT host, user FROM user WHERE user='root';
-- Update host restriction (Use cautiously in production)
UPDATE user SET host='%' WHERE user ='root';
FLUSH PRIVILEGES;
Warning: Allowing remote root access reduces security posture. Restrict to specific IP ranges where possible.