MySQL 5.7.21 installation and configuration method graphic tutorial (window)

MySQL 5.7.21 installation and configuration method graphic tutorial (window)

Install mysql5.7.21 in the window environment. The details are as follows

1. Download the free installation package mysql-5.7.21-winx64.zip from the MySQL official website

2. Unzip to the corresponding directory (here unzip to F:\mysql-5.7.21-winx64)

3. Configure environment variables and add the MySQL startup directory (F:\mysql-5.7.21-winx64\bin) to Path

4. Create the my.ini file in the MySQL directory (F:\mysql-5.7.21-winx64) with the following content:

[mysql] 
# Set the default character set of the mysql client to default-character-set=utf8 
[mysqld] 
#Set port 3306 port = 3306 
# Set the installation directory of mysql to basedir=F:\mysql-5.7.21-winx64 
# Set the storage directory of mysql database data datadir=F:\mysql-5.7.21-winx64\data 
# Maximum number of connections allowed max_connections=200 
# The default character set used by the server is the 8-bit latin1 character set character-set-server=utf8 
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB 

5. Run cmd as an administrator

Change directory: C:\Windows\system32>cd F:\mysql-5.7.21-winx64\bin

Generate MySQL service:

F:\mysql-5.7.21-winx64\bin>mysqld -install 
Service successfully installed.

Generate data directory: F:\mysql-5.7.21-winx64\bin>mysqld --initialize-insecure --user=mysql

Start the MySQL service:

C:\Windows\system32>net start mysql 
The MySQL service is starting. 
The MySQL service has been started successfully.

6. Log in to the database and change the password (the default password is empty)

Log in to the database:

C:\Windows\system32>mysql -uroot -p 
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 2 
Server version: 5.7.21 MySQL Community Server (GPL) 
 
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. 
 
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>

To change your password:

mysql> 
mysql> 
mysql> show databases; 
+--------------------+ 
| Database | 
+--------------------+ 
| information_schema | 
|mysql | 
| performance_schema | 
|sys| 
+--------------------+ 
4 rows in set (0.00 sec) 
 
mysql> use mysql; 
Database changed 
mysql> update user set authentication_string=password("new password") where User="root"; 
Query OK, 1 row affected, 1 warning (0.00 sec) 
Rows matched: 1 Changed: 1 Warnings: 1 
mysql> 
mysql> FLUSH PRIVILEGES;

Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for various versions of MySQL 5.7

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed tutorial for installing mysql5.7.21 under Windows system
  • MySQL 5.7.21 winx64 installation and configuration method graphic tutorial
  • MySQL 5.7.21 installation and password configuration tutorial
  • MySQL 5.7.21 decompression version installation and configuration method graphic tutorial
  • mysql installer web community 5.7.21.0.msi installation graphic tutorial
  • MySQL 5.7.21 winx64 free installation version configuration method graphic tutorial
  • MySQL 5.7.21 installation and configuration tutorial
  • MySQL 5.7.21 decompression version installation and configuration method graphic tutorial (win10)
  • MySQL 5.7.20\5.7.21 free installation version installation and configuration tutorial
  • MySQL 5.7.21 decompression version installation and configuration graphic tutorial

<<:  Simple steps to configure Nginx reverse proxy with SSL

>>:  jQuery plugin to achieve image comparison

Recommend

Tkinter uses js canvas to achieve gradient color

Table of contents 1. Use RGB to represent color 2...

How to optimize logic judgment code in JavaScript

Preface The logical judgment statements we use in...

The most convenient way to build a Zookeeper server in history (recommended)

What is ZooKeeper ZooKeeper is a top-level projec...

How to implement the strategy pattern in Javascript

Table of contents Overview Code Implementation Su...

Practical way to build selenium grid distributed environment with docker

Recently, I needed to test the zoom video confere...

Node quickly builds the backend implementation steps

1. First install node, express, express-generator...

Troubleshooting and solutions for MySQL auto-increment ID oversize problem

introduction Xiao A was writing code, and DBA Xia...

How to solve nginx 503 Service Temporarily Unavailable

Recently, after refreshing the website, 503 Servi...

Detailed explanation of the basic use of react-navigation6.x routing library

Table of contents react-native project initializa...

HTML meta viewport attribute detailed description

What is a Viewport Mobile browsers place web pages...

Detailed usage of Vue timer

This article example shares the specific code of ...

Vue storage contains a solution for Boolean values

Vue stores storage with Boolean values I encounte...

Ansible automated operation and maintenance deployment method for Linux system

Ansible is a new automated operation and maintena...