MySQL installation and use

Published 2026-08-31 17:39 Updated 2026-10-13 17:14 2459 words 13 min read ... Page views Reviewed The content has been read through by me or a friend I trust. Written by someone else Someone else wrote most of this; I only made small edits.

Reviewed The content has been read through by me or a friend I trust.

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, using Navicat Premium 17 to connect to databases, creating databases and tables, performing additions, deletions, and changes, and logging in and managing MySQL through the PowerShell command line. The tutorial emphasizes service running status checking, security password setting and troubleshooting common problems, and provides a complete operating process, which is suitable for beginners to master the basic use 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 packagemysql-8.4.11-winx64.msi
Graphical management toolsNavicat Premium 17
MySQL service nameMySQL84
Default connection port3306

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

Supporting materials folder
Supporting materials folder

This tutorial only introduces installation, initialization, connection and basic use, and does not include MySQL uninstall. Use of root password in the example 123456, 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: Choice 8.4.11 LTS
  • Select Operating System: Choice Microsoft Windows
  • Download Type: Select Windows (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 download page
MySQL Community Server download page

click Download Later, Oracle pages 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.

Skip Oracle account login
Skip Oracle account login
MySQL MSI installation package being downloaded
MySQL MSI installation package being downloaded

run setup

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

enter MySQL Server 8.4 Setup Wizard and click Next。

MySQL Server Installation Wizard
MySQL Server Installation Wizard

in End-User License Agreement Check the page:

I accept the terms in the License Agreement

then click Next。

accept the license agreement
accept the license agreement

Select Typical installation

in Choose Setup Type The page can be seen Typical、Custom and Complete Three installation methods.

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

Select Typical installation
Select Typical installation

enter Ready to install MySQL Server 8.4 Click after page Install。

Prepare to install MySQL Server
Prepare to install MySQL Server

After installation, keep Run MySQL Configurator Check it, then click Finish。

Installation completes and starts MySQL Configurator
Installation completes and starts 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 install it MySQL Configurator Complete the configuration of data directory, port, root password, Windows services, and file permissions in.

Enter Configurator

in Welcome to the MySQL Server Configurator page click Next。

MySQL Server Configurator Welcome Page
MySQL Server Configurator Welcome Page

data directory

Data Directory Used to save 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 Data Catalog
MySQL Data Catalog

Networks and Ports

enter Type and Networking After that, configure it as follows:

configuration itemsrecommended value
Config TypeDevelopment Computer
TCP/IPopen
Port3306
X Protocol Port33060
Named Pipenon-opening
Shared Memorynon-opening
MySQL Network and Port Settings
MySQL Network and Port Settings

Open Windows Firewall ports for network access Used to add MySQL port 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:

parametersvalue
Hostlocalhost or 127.0.0.1
Port3306
Userroot

Set root password

in Accounts and Roles The page sets the root administrator account password.

Fill in this tutorial example:

123456

in MySQL Root Password and Repeat Password Just enter the same password in. below Add User You can create ordinary accounts, but this tutorial will not create additional users.

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

Set root password
Set root password

Configure Windows services

Keep the following settings on the Windows Service page:

  • check Configure MySQL Server as a Windows Service
  • Windows Service Name:MySQL84
  • check Start the MySQL Server at System Startup
  • Service operation account selection Standard System Account

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

Configure MySQL84 Windows Services
Configure MySQL84 Windows Services

File permissions and sample databases

in Server File Permissions The page maintains the first item by default, allowing the MySQL Data Directory to provide full access to only service accounts and administrator groups.

MySQL Data Directory File Permissions
MySQL Data Directory File Permissions

Next, you will ask whether to create Sakila and World Sample database. You will create it yourself later in this tutorial test_db and student Table, so leave these two items unchecked and click directly Next。

Do not install the sample database
Do not install the sample database

application configuration

enter Apply Configuration Click after page Execute。

Start applying MySQL configuration
Start applying MySQL configuration

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 configuration execution successfully
MySQL configuration execution successfully

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

finally click Next, enter Configuration Complete Page, click again Finish。

MySQL initialization configuration completed
MySQL initialization configuration completed

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 the MySQL84。

Under normal circumstances:

  • Status:is running
  • Boot type:automatic
MySQL84 in Windows Services
MySQL84 in Windows Services

If the status is empty, the service has stopped. right-click MySQL84 After that, you can choose "Start","Stop" or "Restart".

When Navicat suddenly cannot connect to MySQL, check first MySQL84 Whether it 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

Provided in supporting materials Navicat17 Folder. If you need to install yourself, you can use the installation references given above.

Navicat Premium 17 Installation Reference
Navicat Premium 17 Installation Reference

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 main interface
Navicat Premium 17 main interface

Create a new MySQL connection

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

Select the MySQL connection type
Select the MySQL connection type

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

parametersexample values
connection nameMySQL84
hostlocalhost
port3306
user nameroot
passwordThe root 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 connection parameters
Navicat MySQL connection parameters

If the test connection fails, check in turn:

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

View the system database

After saving the connection, double click on the left MySQL84。

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 system database
MySQL system database

Create a database and practice SQL

Next, create one with Navicat test_db Database, re-create student Table and complete the insertion and query.

Create test_db

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

new database
new database

Fill in database name:

test_db

Character set selection:

utf8mb4

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

Create the test_db database
Create the test_db database

Create a student table

selected 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 id、name、age and score Four fields, of which id Is a self-increasing primary key.

Write the CREATE TABLE statement
Write the CREATE TABLE statement

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

Student table created successfully
Student table created successfully

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.

Insert data into the student table
Insert data into the student table

query data

Execution:

SELECT * FROM student;

The results area displays id、name、age、score and other fields and corresponding records.

Query student table
Query student table

In the screenshot, Zhang San and Li Si have duplicate records because INSERT Statement is executed twice and 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

Appears after pressing Enter Enter password:, 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 Login to MySQL
PowerShell Login to MySQL

View test_db and student

Continue execution:

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

These orders state respectively:

commandrole
USE test_db;switch to test_db database
SHOW TABLES;View tables in the current database
DESC student;Views student table structure
SELECT * FROM student;query student Table All data
Terminal view student table structure and data
Terminal view student table structure and data

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 MySQL84 Whether the service is running.

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

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 username 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 this machine is occupied by another program 3306, the MySQL service may not 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 explains MySQL's bin Directory is not added to the system Path。

You can use it directly without modifying the environment variables. Go to MySQL first. bin Contents:

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

test_db or student is not displayed

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

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
  • understood MySQL84 Role of Windows services and the ability to start or stop services
  • Connect native MySQL using Navicat Premium 17
  • Create databases and data tables
  • use INSERT write data
  • use SELECT query data
  • 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 a database → Create a table → Insert data → Query data

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

Written by Written by someone else

If you enjoyed this, leave a comment~

Loading...