The official MySQL Reference Manual: https://dev.mysql.com/doc/refman/5.7/en/installing.html
- Step one : Download the MySQL Installer (applies to Windows), and let it all MySQL products on the installation and configuration of the system.
Download: https://dev.mysql.com/downloads/installer/
- Step two : a double-click mysql-installer-community-5.7.24.0.msi
- Step Three : Here I select Custom (Custom), you can also choose to install the default Developer Default All files
- Step four : select to install only the MySQL Server 5.7.24-X64, move it to the right, click Next
- Step five : Set the root user's password, and users can be added through add user
- Step Six : Name mysql service, and here I use the default
Description:
Ⅰ, after installation mysql, mysql default mounted: C:\Program Files\MySQL\MySQL Server 5.7
- bin: to store executable file
- include: the header file storage included
- lib: file repository
- share: Error message and character set files
Ⅱ, default data storage files, and configuration files my.ini: C:\ProgramData\MySQL\MySQL Server 5.7
Ⅲ, mysql configuration file my.ini file
[client]
# 指定客户端从3306端口进入
# pipe=
# socket=MYSQL
port=3306
[mysql]
# 指定客户端的默认字符集
no-beep
default-character-set=utf8
[mysqld]
# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory
# shared-memory-base-name=MYSQL
# The Pipe the MySQL Server will use
# socket=MYSQL
# 设置服务端的端口号
# The TCP/IP Port the MySQL Server will listen on
port=3306
# 指定mysql的安装路径
# Path to installation directory. All paths are usually resolved relative to this.
# basedir="C:/Program Files/MySQL/MySQL Server 5.7/"
# 指定数据的存放路径
# Path to the database root
datadir=C:/ProgramData/MySQL/MySQL Server 5.7/Data
# 指定服务端使用的默认字符集
# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8
# 指定创建新表使用的默认存储引擎
# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB
......
Ⅳ, restart the mysql service
Ⅴ, configure the environment variables
Configuration MYSQL_HOME
Configuration path, adding:
Or add:
Ⅵ, test
C:\Users\ys951>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.24-log MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
Ⅶ, you can also use the official visualization tools and third-party visualization tools to operate the database
When installing mysql workbench tool will be selected for installation