当前位置:网站首页>Windows installation mysql8 (5 minutes)

Windows installation mysql8 (5 minutes)

2022-07-07 01:01:00 Xiao Feng coding

1、 download MySQL

https://dev.mysql.com/downloads/mysql/
image.png
image.png
When the download is complete , Unzip it into your directory .

2、 To configure MySQL Configuration file for

Create a file , The name is :my.ini, Open it with notepad , Enter the following

[client]
#  Set up mysql Client default character set 
default-character-set=utf8
 
[mysqld]
#  Set up 3306 port 
port = 3306
#  Set up mysql Installation directory 
basedir=D:\SoftWare\Local\Work\mysql-8.0.29-winx64
#  Set up  mysql Database data storage directory ,MySQL 8+  The following configuration is not required , The system can be generated by itself , Otherwise, it is possible to report an error 
# datadir=C:\\web\\sqldata
#  Maximum connections allowed 
max_connections=20
#  The character set used by the server defaults to 8 Bit coded latin1 Character set 
character-set-server=utf8
#  The default storage engine that will be used when creating a new table 
default-storage-engine=INNODB

3、 Initialize database

Open... With administrator privileges cmd, Came to mysql Install under directory bin Directory :
Enter the command :mysqld --initialize --console

D:\SoftWare\Local\Work\mysql-8.0.29-winx64\bin>mysqld --initialize --console
2022-07-06T08:38:31.781340Z 0 [System] [MY-013169] [Server] D:\SoftWare\Local\Work\mysql-8.0.29-winx64\bin\mysqld.exe (mysqld 8.0.29) initializing of server in progress as process 18088
2022-07-06T08:38:31.796289Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-06T08:38:32.132148Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-07-06T08:38:33.130450Z 6 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: pn!gQVVuk8(a

pn!gQVVuk8(a It is the password generated by default .

4、 install mysqld

Enter the command :mysqld install

D:\SoftWare\Local\Work\mysql-8.0.29-winx64\bin>mysqld install
Service successfully installed.

5、 start-up mysql

Enter the command :net start mysql

D:\SoftWare\Local\Work\mysql-8.0.29-winx64\bin>net start mysql
MySQL  The service is starting  .
MySQL  Service started successfully .

6、 Sign in mysql

Enter the command :mysql -u root -p
Enter just mysql The default generated password ** **pn!gQVVuk8(a

D:\SoftWare\Local\Work\mysql-8.0.29-winx64\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.29

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> ALTER user 'root'@'localhost' IDENTIFIED BY 'root';
Query OK, 0 rows affected (0.01 sec)

mysql>

7、 Change Password

mysql8+ Change password command : ALTERuser'root'@'localhost' IDENTIFIED BY'root'

原网站

版权声明
本文为[Xiao Feng coding]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061709205831.html