MySQL installation and use

Published 2026-08-31 17:39 Updated 2026-08-31 17:39 2620 words 14 min read ... Page views

This article details the entire process of installing and using MySQL 8.4.11 LTS on Windows 10/11, including downloading the installation package, completing installation and initialization configuration through graphical wizards, setting root passwords and Windows services, connecting to databases using Navicat Premium 17, creating databases and tables, performing additions, deletions, and changes, and accessing MySQL through the PowerShell command line. The tutorial emphasizes service management, security configuration and troubleshooting of common problems, and is suitable for beginners to master the basic operations and environment construction of MySQL.

MySQL 8.4.11 Windows Installation and Usage Tutorial

Available for Windows 10 / 11, including MySQL Server 8.4.11 LTS installation, initialization configuration, service management, Navicat Premium 17 connection, and PowerShell basic operations.

before the start

This tutorial uses the following environment:

ProjectThis Tutorial Environment
Operating SystemWindows 10 / Windows 11 (64-bit)
DatabaseMySQL Community Server 8.4.11 LTS
Installation Kitmysql-8.4.11-winx64.msi
Graphical Management ToolNavicat Premium 17
MySQL service nameMySQL84
Default connection port3306

If you have already obtained the supporting "Data" folder, which contains the Navicat17 folder and mysql-8.4.11-winx64.msi, you can start the installation directly without having to download it repeatedly.

配套资料文件夹
配套资料文件夹

This tutorial only introduces installation, initialization, connection and basic use, and does not include MySQL uninstall. The root password in the example uses 123456 and is only used for classroom demonstrations; a more secure password should be set when actually using it.

Navicat Premium is commercial software. Please use the official trial version, genuine license or legal license provided by the school/organization.

download address


Install MySQL Server

Download the MSI installation package

Open the official download page of MySQL Community Server:

  • Select Version: Select8.4.11 LTS-Select Operating System: SelectMicrosoft Windows- Download type: SelectWindows (x86, 64-bit), MSI Installer

The installation packages used in this tutorial are:

mysql-8.4.11-winx64.msi

The size is about 130 MB. It is recommended to use MSI Installer instead of ZIP Archive because MSI can be installed directly through the graphical installation wizard and includes the MySQL Configurator that you need to use later.

MySQL Community Server 下载页面
MySQL Community Server 下载页面

After clicking Download, the Oracle page may require login to your account. There is no requirement to register to install Community Server. You can click:

No thanks, just start my download.

Start downloading directly.

跳过 Oracle 账号登录
跳过 Oracle 账号登录
MySQL MSI 安装包下载中
MySQL MSI 安装包下载中

run setup

Double click mysql-8.4.11-winx64.msi. If the Windows "User Account Control" prompt pops up, select "Yes".

Enter the MySQL Server 8.4 Setup Wizardand clickNext.

MySQL Server 安装向导
MySQL Server 安装向导

Check on the End-User License Agreement page:

I accept the terms in the License Agreement

Then click Next.

接受许可协议
接受许可协议

Select Typical installation

On the Choose Setup Typepage, you can see three installation methods:Typical,Customand**Complete*.

When used for course study and general development, you can select Typical. This mode installs commonly used MySQL Server components, and can subsequently connect directly through Navicat, Java, Python and other programs.

选择 Typical 安装
选择 Typical 安装

Go to the Ready to install MySQL Server 8.4page and clickInstall.

准备安装 MySQL Server
准备安装 MySQL Server

After the installation is complete, leave Run MySQL Configuratorchecked, and then clickFinish.

安装完成并启动 MySQL Configurator
安装完成并启动 MySQL Configurator

Next, you will automatically enter MySQL's first initialization configuration.


initialize MySQL

Just because the installation is complete does not mean that MySQL is ready to be used directly. After the first installation, you also need to complete the configuration of data directory, port, root password, Windows services, and file permissions in MySQL Configurator.

Enter Configurator

Click Nexton theWelcome to the MySQL Server Configurator page.

MySQL Server Configurator 欢迎页
MySQL Server Configurator 欢迎页

data directory

Data Directory is used to store MySQL database data files. The default directory is usually:

C:\ProgramData\MySQL\MySQL Server 8.4\

Just leave the general learning and development environment as default, and click Next.

MySQL 数据目录
MySQL 数据目录

Networks and Ports

After entering Type and Networking, configure it as follows:

Configuration ItemRecommended Value
Config TypeDevelopment Computer
TCP/IPOpen
Port3306
X Protocol Port33060
Named Pipedoes not open
Shared MemoryNot enabled
MySQL 网络与端口设置
MySQL 网络与端口设置

Open Windows Firewall ports for network access Used to add MySQL ports to Windows Firewall rules.

  • Only connect Navicat, Java, or Python locally: You can uncheck it.
  • Requires other computers to access native MySQL over the network: Configure firewalls based on the actual network environment and security requirements.

Later, when connecting to MySQL, the following three parameters will be mainly used:

ParameterValue
Hostlocalhost or 127.0.0.1
Port3306
Userroot

Set root password

Set the root administrator account password on the Accounts and Roles page.

Fill in this tutorial example:

123456

Just enter the same password in MySQL Root PasswordandRepeat Password. TheAdd User below can create a normal account. This tutorial will not create additional users for the time being.

123456 is for demonstration only. Don't use this weak password in real projects.

设置 root 密码
设置 root 密码

Configure Windows services

Keep the following settings on the Windows Service page:

  • Check the Configure MySQL Server as a Windows Service-Windows Service NameMySQL84
  • Check the box Start the MySQL Server at System Startup- Service operation account selectionStandard System Account

In this way, MySQL will run as a Windows service and start automatically when the system starts up.

配置 MySQL84 Windows 服务
配置 MySQL84 Windows 服务

File permissions and sample databases

Keep the default first item on the Server File Permissions page, so that the MySQL Data Directory provides full access to only service accounts and administrator groups.

MySQL 数据目录文件权限
MySQL 数据目录文件权限

Next, you will be asked whether to create the SakilaandWorldsample databases. Later in this tutorial, you will create your own test_db and student tables, so you will not check these two items and just clickNext.

不安装示例数据库
不安装示例数据库

application configuration

Go to the Apply Configurationpage and clickExecute.

开始应用 MySQL 配置
开始应用 MySQL 配置

Configurator automatically completes operations such as configuration file writing, Windows service configuration, database initialization, file permission setting, service startup, and security configuration.

After the execution is over, confirm that green checkmarks appear on the left side of each item, and see:

The configuration for MySQL Server 8.4.11 was successful.

MySQL 配置执行成功
MySQL 配置执行成功

If a red error mark appears, first open the Log tab to view the specific error information.

Finally, click Nextto enter theConfiguration Completepage, and then clickFinish.

MySQL 初始化配置完成
MySQL 初始化配置完成

At this point, MySQL Server 8.4.11 has been installed and initialized.


Manage MySQL84 services

MySQL Server runs as a service in Windows. The service name for this tutorial is MySQL84. To connect to a database, Navicat, terminals, and other programs must first ensure that the service is running.

View status in Windows services

Press Win + R and enter:

services.msc

Press Enter to open the Service Manager and find MySQL84 in the list.

Under normal circumstances:

  • Status: Running- Start Type:Automatic
Windows 服务中的 MySQL84
Windows 服务中的 MySQL84

If the status is empty, the service has stopped. After right clicking on MySQL84, you can select "Start","Stop" or "Restart".

When Navicat suddenly fails to connect to MySQL, priority should be given to checking whether MySQL84 is running.

Use terminal management services

You can also open CMD, PowerShell, or Windows Terminal with administrator privileges and execute:

net start MySQL84
net stop MySQL84

When you need to restart, you can perform it in turn:

net stop MySQL84
net start MySQL84

If "access denied" occurs or insufficient permissions occur, verify that the terminal is running as an administrator.


Connect to MySQL using Navicat

Install and open Navicat

The Navicat17 folder has been provided in the supporting materials. If you need to install yourself, you can use the installation references given above.

Navicat Premium 17 安装参考
Navicat Premium 17 安装参考

Navicat Premium is commercial software. Please use official trial, genuine license or legal license provided by the school/organization.

Open Navicat Premium 17 after installation is complete. "My Connections" on the left is used to manage database connections, and the top toolbar can perform operations such as queries, tables, views, functions, users and backup.

Navicat Premium 17 主界面
Navicat Premium 17 主界面

Create a new MySQL connection

Click "Connect" in the upper left corner, select MySQL, and then click "Next".

选择 MySQL 连接类型
选择 MySQL 连接类型

Fill in the "New Connection (MySQL)" window:

ParameterExample Value
Connection NameMySQL84
main machinelocalhost
Port3306
User Nameroot
passwordroot password set during installation

The password for this tutorial example is 123456.

After completing the filling, click "Test Connection" first. After the connection is successful, click "OK" to save.

Navicat MySQL 连接参数
Navicat MySQL 连接参数

If the test connection fails, check in turn:

  • Is the MySQL84 service running?
  • Whether the port is 3306
  • Whether the user name is root
  • Is the root password correct?

View the system database

After saving the connection, double-click MySQL84 on the left.

After the connection is successful, you can generally see:

  • information_schema
  • mysql
  • performance_schema
  • sys

These are MySQL's own system databases and are not recommended to modify them at will during the beginning stage.

MySQL 系统数据库
MySQL 系统数据库

Create a database and practice SQL

Next, create a test_db database through Navicat, then create a student table and complete the insertion and query.

Create test_db

Right-click the MySQL84 connection on the left and select "New Database".

新建数据库
新建数据库

Fill in database name:

test_db

Character set selection:

utf8mb4

utf8mb4 can completely store Unicode characters and is suitable for Chinese, English and other characters. Just leave the sorting rules as default.

创建 test_db 数据库
创建 test_db 数据库

Create a student table

Select test_db, click "New Query", and execute:

CREATE TABLE student (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(50),
    age INT,
    score DECIMAL(5,2)
);

This table contains four fields: id, name, age and score, of which id is a self-increasing primary key.

编写 CREATE TABLE 语句
编写 CREATE TABLE 语句

Click "Run". If "Success 1, Error 0" or OK appears below, the table has been created successfully.

student 表创建成功
student 表创建成功

Insert test data

Continue execution:

INSERT INTO student (name, age, score)
VALUES
('张三', 20, 88.5),
('李四', 21, 92.0);

If the results show:

Affected rows: 2

This means that the two pieces of data were inserted successfully.

向 student 表插入数据
向 student 表插入数据

query data

Execution:

SELECT * FROM student;

Fields such as id, name, age, and score and corresponding records will be displayed in the result area.

查询 student 表
查询 student 表

There are duplicate records for Zhang San and Li Si in the screenshot because the INSERT statement was executed twice, which does not affect the explanation of query operations in this tutorial.


Using PowerShell to operate MySQL

Navicat is a graphical management tool, and MySQL can also be operated directly through a command-line client. After mastering basic terminal operations, you can also manage databases in an environment without a graphical interface.

Enter the MySQL bin directory

The default installation directory for MySQL 8.4 is usually:

C:\Program Files\MySQL\MySQL Server 8.4\bin

Open PowerShell or Windows Terminal and execute:

cd "C:\Program Files\MySQL\MySQL Server 8.4\bin"

log in to MySQL

Run the MySQL client in the current directory in PowerShell:

.\mysql -u root -p

Press Enter and Enter password: appears. Enter the root password set during installation.

The terminal usually does not display characters when entering a password, which is normal. After successful login, it will appear:

mysql>

You can first view the database in the current server:

SHOW DATABASES;
PowerShell 登录 MySQL
PowerShell 登录 MySQL

View test_db and student

Continue execution:

USE test_db;
SHOW TABLES;
DESC student;
SELECT * FROM student;

These orders state respectively:

ordersto act on
USE test_db;Switch to test_db database
SHOW TABLES;View tables in the current database
DESC student;View student Table Structure
SELECT * FROM student;Query all data from student Table
终端查看 student 表结构和数据
终端查看 student 表结构和数据

Navicat and the command line are connected to the same MySQL Server, so databases, tables and data created in Navicat can also be queried directly on the command line.


common problems

First check whether the MySQL84 service is running.

Press Win + R to enter services.msc; or use the administrator terminal to execute:

net start MySQL84

If the service itself does not start, Navicat cannot connect properly.

Access denied for user root

Usually the username or password is incorrect.

Check the following:

  • Whether the user name is root
  • Whether the password entered is consistent with that set in Configurator
  • Does Navicat save old passwords

If Navicat saves an old password, edit the connection and re-enter it.

Port 3306 connection failed

Make sure that the port used by Navicat is consistent with the port set in MySQL Configurator. This tutorial is 3306.

If there are other programs on this machine that use 3306, the MySQL service may not be able to start normally, and you need to check the port occupancy or reconfigure the MySQL port.

PowerShell prompts that mysql is not a recognized command

This usually means that MySQL's bin directory has not been added to the system Path.

You can use it directly without modifying the environment variables. First enter the bin directory of MySQL:

cd "C:\Program Files\MySQL\MySQL Server 8.4\bin"
.\mysql -u root -p

test_db or student is not displayed

Right-click on the connection or database on the left side of Navicat and select "Refresh", or reopen the MySQL84 connection.

You can also check in turn in the terminal:

SHOW DATABASES;
USE test_db;
SHOW TABLES;

Basic operating process after completion

After completing the above steps, you should be able to:

  • Install and initialize MySQL Community Server 8.4.11 LTS on Windows 10 / 11
  • Understand the role of MySQL84 Windows services and be able to start or stop services
  • Connect native MySQL using Navicat Premium 17
  • Create databases and data tables
  • Write data using INSERT
  • Query data using SELECT
  • Log in to MySQL using PowerShell and execute basic SQL commands

When practicing daily, you can write down the entire process as:

Start MySQL84 → Log in to MySQL → Select/create database → Create table → Insert data → Query data

After completing these basics, you can continue to learn SQL, database design, and Java / Python projects connecting to MySQL.

If you enjoyed this, leave a comment~

... Page views
© 2026 跨越星轨的客 @Hoshiumi
Powered by theme astro-koharu · Inspired by Shoka