当前位置:网站首页>MySQL 8.0.29 installation and configuration method graphic tutorial (Windows zip version)

MySQL 8.0.29 installation and configuration method graphic tutorial (Windows zip version)

2022-06-10 02:19:00 1024 Q

MySQL 8.0.29 Detailed installation (windows zip edition ), For your reference , The details are as follows

1 Official website

Official website address :MySQL

2 download

Download address :MySQL :: Download MySQL Community Server

The following interface appears , No login or registration required , Just click No thanks, just start my download. Ready to download .

3 Installation and configuration

Be careful : This article uses win11 Installation , Other versions also apply .

① Unzip the downloaded package to the directory you want to install .

② establish my.ini The configuration file . stay MySQL Under the root directory of , New text document , And then rename it as my.ini,( Note that it should be modified along with the extension ), Then paste the following and save , Pay attention to modifying the installation directory and data storage directory path .

[mysqld]# Set up 3306 port port=3306# Set up mysql Installation directory basedir=[mysql Root path ]# Set up mysql Database data storage directory datadir=[mysql Root path ]\\data# Maximum connections allowed max_connections=200# Number of connection failures allowed .max_connect_errors=10# The character set used by the server defaults to utf8mb4character-set-server=utf8mb4# The default storage engine that will be used when creating a new table default-storage-engine=INNODB# By default “mysql_native_password” Plug in authentication #mysql_native_passworddefault_authentication_plugin=mysql_native_password[mysql]# Set up mysql Client default character set default-character-set=utf8mb4[client]# Set up mysql The default port when the client connects to the server port=3306

③ Configure environment variables . Right click this computer in turn → attribute → Advanced system setup → environment variable ; Or press win+s The shortcut key opens the search panel , Enter the system environment variable , In turn, click “ Edit system environment variables ”→ The environment variable is just .

After opening the environment variables dialog box , Click on “ newly build ” Button , Enter the variable name in sequence :MYSQL_HOME( You can do whatever you want ), A variable's value :mysql Root address , Then click OK .

Then double click. path, Open edit box , Click on “ newly build ” Button , Input mysql bin Directory address , Such as D:\software\mysql-8.0.29-winx64\bin perhaps %MYSQL_HOME%\bin.

Be careful : Click OK after configuration .

④ Run as administrator cmd( Be careful : Must run as Administrator , Otherwise, the authority is not enough ), You can search in the taskbar cmd, And then click “ Run as administrator ”.

⑤ Input mysqld --initialize-insecure Command and return , Aimed at mysql Generate... In the root directory data Folder , Used to store the database .

⑥ Input mysqld install command , For installation mysql service .

mysqld install

If the following interface appears , Indicates that... Is installed mysql service , You can enter sc delete mysql Command to uninstall the service , Then install it .

sc delete mysql

⑦ thus mysql Installation complete , have access to net start mysql To start up mysql service .

If you want to shut down the service, you can use net stop mysql command .

4 Log in and set your password

① Just now we initialized the database using mysqld --initialize-insecure command , Express Do not generate random password , Set database null password , So we can use mysql -uroot -p Command to log in , The user name defaults to root.

mysql -uroot -p

② After login , Enter the following command to set the password .

set password for [email protected] = ' New password ';

5 How to change the password after forgetting it ?

① First, make sure mysql The service is off , Then the input mysqld --console --skip-grant-tables --shared-memory Command to start the service without secret .

mysqld --console --skip-grant-tables --shared-memory

② Then open one more cmd window ( Notice that another , Do not close the currently open ), Input mysql -uroot -p command , And click enter twice to log in without secret ( Or just type in mysql And enter ).

③ Change Password .

use first flush privileges; Command refresh permission .

flush privileges;

Then use it directly set password for [email protected] = ' New password '; Command to set the password .

set password for [email protected] = ' New password ';


原网站

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