MySQL 5.7.15 installation and configuration method graphic tutorial (windows)

MySQL 5.7.15 installation and configuration method graphic tutorial (windows)

Because I need to install MySQL, I record the installation process as follows. While recording it myself, I hope it will be helpful to those who have questions.

1. Download the software

1. Go to the MySQL official website, log in to your Oracle account (register one if you don’t have one), and download Mysql-5.7.15 from: http://dev.mysql.com/downloads/mysql/

2. Unzip the downloaded file to the specified directory. I unzipped it in D:\mysql-5.7.15-winx64

2. Installation Process

1. First configure the environment variable path and configure D:\mysql-5.7.15-winx64\bin to your own path. The details will not be described in detail again.

2. Copy my-default.ini in the decompression path and change the name to my.ini as shown below

3. Open the file my.ini and add the following content:

[mysqld] 
basedir=D:\\mysql-5.7.15-winx64 
datadir=D:\\mysql-5.7.15-winx64\\data 
port=3306 

sql_mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Where basedir: is the decompression path of the above mysql

datadir: Subsequent initialization and other data will be saved in this directory (Note: Do not create a new data folder in this file directory. My new data folder will be wrong. Follow my steps and it will be automatically created in subsequent operations.)
port: indicates the port for connecting to the database
sql_mode: indicates the sql mode

3. Initialize the database and configure related information

1. Run the Windows command line as an administrator (special reminder: WIN7 and above systems must use administrator identity here, otherwise subsequent operations will go wrong)

2. Enter the mysql decompression directory D:\mysql-5.7.15-winx64\bin (Reminder: You need to enter the bin directory here, otherwise subsequent operations will cause errors)

3. Enter: mysqld --initialize --user=mysql --console, and initialize after execution. At this time, the initial password of root will be generated.

Note the initialization password generated at this time.

4. Register the Mysql service. Run the command: mysqld --install MySQL

If the prompt "Service successfully installed." appears, it proves that the MySQL service is successfully installed.

5. At this point, you can start the mysql service, net start mysql

Users may encounter the following errors:
A system error has occurred 2. The system cannot find the specified file.

Cause of the error: As mentioned above, when running the installation service command: mysqld --install MySQL, we did not enter the bin directory for installation.
Solution: Go to the bin directory, first remove the service, and run the command mysqld --remove
Service successfully removed.
Reinstall the MySQL service, run the command mysqld --install, and then start the MySQL service
D:\mysql-5.7.15-winx64>net start mysql
MySQL service is starting
MySQL service has been started successfully. At this time, the MySQL service has been started successfully.

4. Log in to the database and change the password

In the my.ini file, add skip-grant-tables after [mysqld]
At this point, shut down the mysql service and restart it.
(Enter net stop mysql in the command line to shut down the MySQL service, and enter net start mysql to start the MySQL service)
Login: Enter mysql -u root -p and press Enter. If the password is blank, do not enter it and press Enter to log in to MySQL.

Select mysql database:

Query the user table of the MySQL database, select * from user

At this point, we find that the name of the password field is authentication_string. Some may be passwords, depending on the results of your query.
Perform an update operation on the user table: update user set authentication_string = password("123456") where user="root"

The operation was successful. Exit mysql
Delete skip-grant-tables in the my.ini file and restart the mysql service. Log in to MySQL

Possible subsequent problems:
After installing MySQL and logging in, no matter what command you run, you will always be prompted with this: You must reset your password using ALTER USER statement before executing this statement.

When this problem occurs, you only need to continue running the following two commands in the mysql command line:

ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;

flush privileges;


Note: The above are 2 commands and need to be executed separately.

After completing the above two commands, MySQL is installed completely.

Reference: MySQL 5.7.14 Installation and Configuration Methods Graphic Tutorial

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

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:
  • MySQL 5.7.15 installation and configuration method graphic tutorial
  • Tutorial on installing mysql5.7.17 on windows10
  • MySQL 5.7.3.0 installation and configuration graphic tutorial under Windows (installation version)
  • MySQL 5.7.17 installation and configuration method graphic tutorial (windows)
  • MySQL 5.7 installation tutorial (windows)
  • mysql5.7.13.zip installation tutorial (windows)
  • mysql5.7.18.zip Installation-free version configuration tutorial (windows)
  • MySQL 5.7.17 free installation version configuration method graphic tutorial (windows10)
  • MySQL 5.7.17 installation and configuration method graphic tutorial (windows10)
  • mysql5.7.19 winx64 decompressed version installation and configuration tutorial

<<:  Detailed explanation of DOM DIFF algorithm in react application

>>:  Detailed explanation of bash command usage

Recommend

Javascript front-end optimization code

Table of contents Optimization of if judgment 1. ...

Complete steps for Nginx to configure anti-hotlinking

need: Usually, sites want to prevent videos and p...

Vue v-model related knowledge summary

​v-model is a Vue directive that provides two-way...

MySQL 5.7.21 installation and configuration tutorial under Window10

This article records the installation and configu...

Linux kernel device driver virtual file system notes

/******************** * Virtual File System VFS *...

Differences between ES6 inheritance and ES5 inheritance in js

Table of contents Inheritance ES5 prototype inher...

Introduction to generating Kubernetes certificates using OpenSSL

Kubernetes supports three types of authentication...

CSS pseudo-element::marker detailed explanation

This article will introduce an interesting pseudo...

An article to understand the usage of typeof in js

Table of contents Base Return Type String and Boo...

SQL group by to remove duplicates and sort by other fields

need: Merge identical items of one field and sort...

Sample code for making desktop applications with vue + Electron

1.vue packaging Here we use the vue native packag...

Discussion on the problem of garbled characters in iframe page parameters

I encountered a very unusual parameter garbled pro...

Several ways to switch between Vue Tab and cache pages

Table of contents 1. How to switch 2. Dynamically...

Vue implements the product tab of the product details page function

This article example shares the specific code of ...

Docker Compose network settings explained

Basic Concepts By default, Compose creates a netw...