Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Deploying MySQL 8.0 on Windows Without an Active Internet Connection

Tech May 8 4

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.

  1. Open System Properties > Environment Variables.
  2. Edit the Path system variable.
  3. Append the bin folder 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.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.