Mysql detailed installation steps

Table of contents

1. Unzip the server-side Mysql installation package

 2. Copy and change the my.ini file

 3. Install the MySQL service

4. Start the mysql service 

6. Record the initial password, log in with the initial password & 7. Change the MySQL link password     


 

1. Unzip the server-side Mysql installation package

The directory after decompression is as above.

 2. Copy and change the my.ini file

Add the my.ini file to the directory

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

[mysqld]
#设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=E:/mysql/mysql-8.0.18-winx64
# 设置mysql数据库的数据的存放目录
datadir=E:/mysql/mysql-8.0.18-winx64/data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

 Modify the my.ini file

This screenshot is taken after the data file is generated, so logically speaking, there is no data file in the newly decompressed file.

 3. Install the MySQL service

Execute the following command in the mysql bin directory 

mysqld -install (install mysql )

unsuccessful:

 success:

 

Initialize MySQL    

mysqld --initialize --console

 After that, you can see an additional data folder, because I have already installed it from the beginning, if it is just decompressed, there is no data folder in the mysql file.

4. Start the mysql service 

net start mysql

Note that if the service name is displayed here invalid

Then be sure to run the DOS window as an administrator 

 

6. Record the initial password, log in with the initial password & 7. Change the MySQL link password     

mysql -P 3306 -u root -p

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

 The modification is successful, and then we will test it again, using our modified password to log in:

 OK, so now our mysql server is installed, and the next step is to connect to our client, and it can be used after decompression.

 log in

 

Create a new database:

OK, it's over!

Guess you like

Origin blog.csdn.net/m0_67094505/article/details/128195146