MySQL installation, configuration, startup and shutdown

1. Content overview

Main content of this article:

  1. MySQL download;
  2. MySQL installation;
  3. Configure environment variables;
  4. Log in to the MySQL server;
  5. Query the system database;
  6. start and stop services;

2. Install, configure, start and shut down services

2.1. MySQL download

You can download it from the MySQL official website.

2.1.1. Official website

https://www.mysql.com/

2.1.2. Download steps

insert image description here

insert image description here

insert image description here

insert image description here
insert image description here

Downloaded installation package:

insert image description here

2.2. MySQL installation

Double-click the installer to start the installation.
insert image description here

insert image description here

Default installation path:
insert image description here

Customize the installation path and install it in the corresponding directory of the D drive.
MySQL is installed in the D disk-MySQL directory;
data is stored in the D disk-MySQLData directory;

insert image description here
insert image description here
insert image description here

insert image description here

insert image description here

insert image description here

insert image description here

insert image description here

insert image description here
insert image description here

insert image description here

insert image description here

2.2.1. Test whether the installation is successful

Check the MySQL version. If it can be displayed normally, the installation is successful.

Enter the bin directory of the MySQL installation directory, open the command line, and enter the following command:

mysql --version

insert image description here
insert image description here

2.3. Configure environment variables

insert image description here

insert image description here
New environment variable

D:\MySQL\MySQL Server 8.0\bin

insert image description here

The test environment variable configuration is successful.
As long as you open the command line, you can directly query the MySQL version, which means that the environment variable configuration is successful.
insert image description here

2.4. Log in to the MySQL server

Enter the following command:
root, is the administrator account;
after pressing Enter, you will be asked to enter the password.

mysql -u root -p

insert image description here

2.5. Query the default system database

show databases;

insert image description here

2.6. Starting and shutting down services

Check mysqlthe running status:
Computer - right click - manage, enter 计算机管理the page, find 服务.
insert image description here

Note: Opening and closing MySQL requires administrator privileges, so it must be run as an administrator.
insert image description here

Note: mysql80 is the service name of mysql, which is specified during installation; 服务it can be seen on the above page.

2.6.1. Close mysql

Open cmd with administrator privileges to enable and disable MySQL.

net stop mysql80

insert image description here

2.6.2. Start mysql

net start mysql80

insert image description here

3. MySQL release log

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-34.html

4. Reference

B station video: MySQL 8.0 nanny level download, installation and configuration tutorial
Link to this video text version tutorial: https://questionmark001.github.io/2022/03/12/mysql80setup/

Guess you like

Origin blog.csdn.net/sgx1825192/article/details/132390713