Getting started with MySQL download

MySQL

mysql download

https://dev.mysql.com/downloads/mysql/

Configuration Environment

Add your mysql path to Path in the environment variable,
such as: D:\2345Downloads\mysql-8.0.25-winx64\mysql-8.0.25-winx64\bin

Configuration file

In the mysql root directory, create a new mysql.ini folder with the following contents

[mysql]

# 设置mysql客户端默认字符集
default-character-set=utf8 

[mysqld]

#设置3306端口
port = 3306 

# 设置mysql的安装目录
basedir=D:\2345Downloads\mysql-8.0.25-winx64\mysql-8.0.25-winx64

# 设置mysql数据库的数据的存放目录
datadir=D:\2345Downloads\mysql-8.0.25-winx64\mysql-8.0.25-winx64\data

# 允许最大连接数
max_connections=200

# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8

# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

Configuration command

Enter the following command under the bin path of mysql to generate the data file.
mysqld --initialize-insecure
Install the service.
mysqld --install
Start mysql
net start mysql
so that mysql is started.

Set mysql time zone

mysql -hlocalhost -uroot -p
Press Enter, the default password is 123456, if you see the time zone is SYSTEM, it is not set.
Set Dongba time zone
set global time_zone = '+8:00';

Insert picture description here

IDEA configure MySQL

After starting mysql, we can also configure mysql to IDEA project.
Open IDEA, View -> Tool Windows -> Database, create a new MySQL

Insert picture description here

If

Insert picture description here


there is no item to configure MySQL , you can leave it blank.
Click Test Connection. The link failed for the first time. Later, I found that the MySQL downloaded by default did not have a time zone set. You can test after setting the time zone. Then you can complete IDEA configuration of MySQL. .