Detailed steps to install mysql


1. Download address

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

insert image description here

Unpacked version:

Link: https://pan.baidu.com/s/1YFWoFMvOqkSab21eg7fl7w?pwd=bje6
Extraction code: bje6
Copy this content and open Baidu Netdisk App

insert image description here

2. Add operation

1. Create a file called my.ini

insert image description here

2. Modify the my.ini file

insert image description here

[mysql]
#设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置3306端口
port = 3306
basedir =D:\\shujuku\\mysql\\
datadir=D:\\shujuku\\mysql\\data
max_connections=20
character-set-server=utf8
default-storage-engine=INNODB
sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Notice! ! !

(1) The directory must be "\", do not write "\"
(2) Mysql installation directory and data storage must be modified to the directory set by yourself, unless the set directory is consistent with the above

3. Configure the environment variables of mysql

insert image description here
Click path to join mysql
insert image description here

Four, run cmd

Run cmd as an administrator
to enter the bin directory
insert image description here

Excuting an order

mysqld --initialize

insert image description here
At this time, a new directory data will be generated. View the .err file to view the random password generated by the root user.
insert image description here
Random password:
insert image description here

Execute the command to install the mysqld service

mysqld --install

insert image description here

Execute the command to start the service

net start mysql

insert image description here
Connect to the database

mysql -u root -p
enter a randomly generated password

insert image description here

change root password

ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘root’;

insert image description here
Successfully modified

exit mysql
insert image description here

Guess you like

Origin blog.csdn.net/qq_64451048/article/details/129303450