当前位置:网站首页>MySQL 8.0.29 decompressed version installation and configuration method graphic tutorial

MySQL 8.0.29 decompressed version installation and configuration method graphic tutorial

2022-06-09 17:38:00 1024 Q

For the computer there is no Visual C++ 2019.exe It will not be installed Mysql Install Friend, , This detailed procedure will be clearer .

One 、 download ( Official website :MySQL) Click the "MySQL" You can jump .

Slide the page down to the bottom , And click the corresponding position of the picture .

Click on :Download Download

Click on the picture ok 了 , You can start next !

Two 、 decompression , Here are some operations :( Unzip the download file , And put it in the place you like , Location of the author file :C:\Program Files\MySQL\mysql-8.0.29-winx64) Provide reference

(1) Create a file called “my.ini” And edit ( If in C Cannot create file on disk , Can be created on the desktop ):

[mysql]# Set up mysql Client default character set default-character-set=utf8[mysqld]# Set up 3306 port port = 3306# Set up mysql Installation directory basedir = C:\\Program Files\\MySQL\\mysql-8.0.29-winx64\\# Set up mysql Database data storage directory datadir = C:\\Program Files\\MySQL\\mysql-8.0.29-winx64\\data# 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# Create mode sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

C:\\Program Files\\MySQL\\mysql-8.0.29-winx64\\ This directory must be “\\”, Don't make it “\” Otherwise, it will report a mistake ,
Mysq The installation directory and data storage directory must be modified to the directory set by yourself , Unless the directory you set is consistent with the above .

(2) Will edit the good “myini” Drag the file into the unzipped file ( And bin Equal directory drive )

(3) To configure MySQL Environment variables of : 

Create a new system variable in the system variable , And fill in the corresponding information , Click OK .

MYSQL_HOMEC:\Program Files\MySQL\mysql-8.0.29-winx64 # This is a bin The directory above

Again , Look for... In system variables Path, Click edit , After adding at the bottom , Click OK , Exit the next time .

%MYSQL_HOME%bin

  3、 ... and 、 Run as an administrator cmd, And do the following :

(1) Switch to mysql Of bin Catalog :

=========================================================
open cmd after , The default is :    C:\Users\28690>
If the previously unzipped file is put into D Under the plate , First, enter :d:     Jump to D Under the plate
In the input :    cd: File path    
Transferred to bin Under the table of contents cd C:\Program Files\MySQL\mysql-8.0.29-winx64\bin
C:\Program Files\MySQL\mysql-8.0.29-winx64\bin>
And it worked !
=========================================================

(2) perform   mysqld --initialize command , It will be in bin Generate a new directory in the same level directory of data, Click on data, see .err file , You can see root User generated random password ;

If you cannot edit it directly , You can copy it and drag it to the desktop to view it , The target box is :root User generated random password

(3) perform mysqld --install command , install mysqld service :

mysqld --install

(4) perform net start mysql command , start-up mysql service :

net start mysql

(5) perform mysql -u root -p command , Connect mysql database , Enter the randomly generated password above ( The password here can only “ Pure hand tap ”):

mysql -u root -p

(6) perform sql Reset root Password operation :

mysql> alter user 'root'@'localhost' identified with mysql_native_password by ' New password ';

tips:

mysqld –initialize-insecure Automatically generate no password root user ;

mysqld –initialize Automatically generate... With random password root user ;

mysqld -remove Remove your own mysqld service ;

net stop mysql command , stop it mysql service

If an error , Please delete data Folder , Repeat the above operation  


原网站

版权声明
本文为[1024 Q]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206091713584611.html