Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Installing and Configuring MySQL 5.7 on Windows

Tech 1

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 Path variable and append C:\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), locate MySQL and click Start.
  • Or run the command:
net start MySQL

8. Configure the Root Account and Create Databases

  1. Log in without a password (press Enter when prompted):
mysql -uroot -p
  1. 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;
  1. Exit and reconnect with the new password:
mysql -uroot -pYourPassword
  1. Create the required databases:
CREATE DATABASE jira CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

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.