1. Content overview
Main content of this article:
- MySQL download;
- MySQL installation;
- Configure environment variables;
- Log in to the MySQL server;
- Query the system database;
- 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
2.1.2. Download steps
Downloaded installation package:
2.2. MySQL installation
Double-click the installer to start the installation.
Default installation path:
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;
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
2.3. Configure environment variables
New environment variable
D:\MySQL\MySQL Server 8.0\bin
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.
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
2.5. Query the default system database
show databases;
2.6. Starting and shutting down services
Check mysql
the running status:
Computer - right click - manage, enter 计算机管理
the page, find 服务
.
Note: Opening and closing MySQL requires administrator privileges, so it must be run as an administrator.
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
2.6.2. Start mysql
net start mysql80
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/