Installing and Configuring MySQL 5.7 on Windows
1. Donwload the Distribution
Obtain the MySQL 5.7 ZIP archive from the official site:
https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.33-winx64.zip
2. Extract the Archive
Unzip the downloaded file into a directory without spaces (for example, C:\mysql). The folder structure should contain bin, data, and other directories.
3. Configure Environment Variables
Add the MySQL bin folder to the system PATH:
- Open System Properties > Environment Variables.
- Edit the
Pathvariable and appendC:\mysql\bin.
4. Initialize the Data Directory
Open a Command Prompt and run:
cd C:\mysql\bin
mysqld --initialize-insecure --user=mysql
If you encounter an error about missing MSVCR120.dll, install the required Microsoft Visual C++ Redistributables:
https://aka.ms/vs/17/release/vc_redist.x64.exe
https://aka.ms/vs/17/release/vc_redist.x86.exe
https://download.microsoft.com/download/1/8/0/180fa2ce-506d-4032-aad1-9d7636f85179/vcredist_x64.exe
Download and install all three packages, then restart the system.
5. Install the Windows Service
Launch Command Prompt as Administrator and execute:
cd C:\mysql\bin
mysqld install
This registers MySQL as a system service.
6. Create the Configuration File
In the MySQL root directory (C:\mysql), create a file named my.ini with the following content:
[client]
port=3306
[mysql]
no-beep
[mysqld]
port=3306
default-storage-engine=INNODB
max_allowed_packet=256M
innodb_log_file_size=256M
character_set_server=utf8mb4
innodb_default_row_format=DYNAMIC
innodb_large_prefix=ON
innodb_file_format=Barracuda
transaction-isolation=READ-COMMITTED
log-output=FILE
general-log=0
general_log_file="execute_sql_result.log"
slow-query-log=1
slow_query_log_file="user-slow.log"
long_query_time=10
log-error=mysql.err
server-id=1
lower_case_table_names=1
max_connections=151
table_open_cache=2000
tmp_table_size=16M
thread_cache_size=10
7. Launch the Service
Start the MySQL service using one of these methods:
- From the Services console (
services.msc), locateMySQLand click Start. - Or run the command:
net start MySQL
8. Configure the Root Account and Create Databases
- Log in without a password (press Enter when prompted):
mysql -uroot -p
- Set a password and enable remote access:
USE mysql;
UPDATE user SET authentication_string = PASSWORD('YourPassword') WHERE User = 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'YourPassword';
FLUSH PRIVILEGES;
- Exit and reconnect with the new password:
mysql -uroot -pYourPassword
- Create the required databases:
CREATE DATABASE jira CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;