MySQL 5.7.23 version installation tutorial and configuration method

MySQL 5.7.23 version installation tutorial and configuration method

It took me three hours to install MySQL myself. Even though there are so many tutorials, I still wasted too much time on things that shouldn't have been spent. I hope this article can help you avoid detours~~

1. Download

https://www.mysql.com/ Official website address

I downloaded the 64-bit version.

2. Unzip

After downloading, I chose to decompress it directly to drive D. The file address is: D:\mysql-5.7.23-winx64. I made it clear here for the subsequent environment configuration. You can also choose the corresponding location according to your personal preferences.

3. Environment Configuration

The environment configuration is for later installation using cmd administrator commands.

First, use the control panel, open the system, find advanced system settings -> environment variables


insert image description here

There are two ways to configure the environment:

Method 1: Create a new variable in the system variable named MYSQL_HOME (you can also use your own preference, but it must be letters), and write the variable value to the corresponding mysql location. I wrote D:\mysql-5.7.23-winx64 here

insert image description here
Next, edit and create a new path, %MYSQL_HOME%\bin, which corresponds to the bin directory in the mysql file.
insert image description here
insert image description here

Method 2: Create a new one directly in the system variable path editor, D:\mysql-5.7.23-winx64\bin, which is the bin directory file address in the mysql file.
Note: Click OK after each environment variable edit, otherwise it will fail.

4. Create a new my.ini file. There is no such file in version 5.7, so you need to create it yourself. The content is as follows: Please note that you need to modify your own file address and version information.

[mysqld]port = 3306basedir = D:/mysql-5.7.23-winx64datadir = D:/mysql-5.7.23-winx64/datamax_connections = 200character-set-server = utf8default-storage-engine = INNODBsql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES[mysql]default-character-set = utf8

After completing these configurations, you can start the installation. I spent a long time fiddling with the following process. It hurts to think about it. I would feel sorry for my detour if I didn’t write it down. I also hope it can help everyone save time.

5. Installation

First, run cmd as an administrator and enter the bin directory file address: D:\mysql-5.7.23-winx64\bin. You will find that it always prompts:


insert image description here

It has obviously been configured. You will find various tutorials online saying that when setting environment variables, add a ";" or a period in front of the file address and a semicolon after it. In fact, the Windows 10 system does not require these, and this prompt will appear no matter how you add it. The final solution is:

C:\WINDOWS\system32>cd /d D:\mysql-5.7.23-winx64\bin

It's so unexpected and shocking that I almost want to vomit blood. Just add in front of the file address cd /d will do the trick.
The next process is:

D:\mysql-5.7.23-winx64\bin>mysqld -installService successfully installed.

After the installation is successful, start the configuration. Execute the following code and you will find that there is a data folder in the mysql folder.

D:\mysql-5.7.23-winx64\bin>mysqld --initialize-insecure --user=mysql

Then

D:\mysql-5.7.23-winx64\bin>net start mysqlMySQL service is starting.MySQL service has been started successfully.

Okay, now you can start using it. Let’s happily start the journey of training your SQL skills~~O(∩_∩)O

D:\mysql-5.7.23-winx64\bin>net start mysql

enter mysql -u root -p, the system will prompt you to enter Enter passwords:, this time you need Reset your password.

Steps:

1. Edit the MySql configuration file: my.ini (in the MySql installation directory).

Open the configuration file, add skip-grant-tables after the first line of the last line of the file, then save and exit.
This means that grant-tables will not be started when starting MySQL.

2. Restart the MySql service: first close net stop mysql, then start net start mysql

3. Set a new root password.

mysql -u root -p Press Enter directly to enter the database without entering a password.

At this time, execute use mysql in the command line (switch to the system database)

Execute the following statement to modify the root user password:

update user set authentication_string=PASSWORD(“123456”) where user='root';

The password set at this time is: 123456

4. Note: Restore the configuration file, that is, delete the line of code just added in my.ini.

Close the cmd interface window and reopen it. Start the mysql service, net start mysql

Enter your account name and password 123456

C:\WINDOWS\system32>mysql -u root -pEnter password: ******

The results show:

Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 3Server version: 5.7.23 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 itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

You can start the database operation~~

Summarize

The above is the installation tutorial and configuration method of MySQL 5.7.23 version introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Tutorial on installing mysql5.7.23 on Ubuntu 18.04
  • Ubuntu 18.04 installs mysql 5.7.23
  • The latest MySQL 5.7.23 installation and configuration graphic tutorial
  • MySQL 5.7.23 decompression version installation tutorial with pictures and text
  • Pitfalls and solutions for upgrading MySQL 5.7.23 in CentOS 7
  • MySQL 5.7.23 winx64 installation and configuration method graphic tutorial under win10
  • MySQL 5.7.23 installation and configuration graphic tutorial
  • mysql 5.7.23 winx64 decompression version installation tutorial
  • MySQL 5.7.23 installation and configuration method graphic tutorial
  • Binary installation of mysql 5.7.23 under CentOS7

<<:  JavaScript to implement dynamic digital clock

>>:  Detailed explanation of Docker fast build and Alibaba Cloud container acceleration configuration under Windows 7 environment

Recommend

Detailed explanation of MySQL 8.0 password expiration policy

Starting from MySQL 8.0.16, you can set a passwor...

CSS3 uses var() and calc() functions to achieve animation effects

Preview knowledge points. Animation Frames Backgr...

Summary of tips for making web pages

Preface This article mainly summarizes some of th...

Detailed installation and configuration tutorial of PostgreSQL 11 under CentOS7

1. Official website address The official website ...

In-depth understanding of Vue's plug-in mechanism and installation details

Preface: When we use Vue, we often use and write ...

Vue uses custom instructions to add watermarks to the bottom of the page

Project Scenario Add a custom watermark to the en...

Navicat connects to MySQL8.0.11 and an error 2059 occurs

mistake The following error occurs when connectin...

Tomcat class loader implementation method and example code

Tomcat defines multiple ClassLoaders internally s...

How to write the introduction content of the About page of the website

All websites, whether official, e-commerce, socia...

Docker implements cross-host container communication based on macvlan

Find two test machines: [root@docker1 centos_zabb...

4 Scanning Tools for the Linux Desktop

While the paperless world has not yet emerged, mo...

Exploration and correction of the weird behavior of parseInt() in js

Background: I wonder if you have noticed that if ...

Simple usage example of MySQL 8.0 recursive query

Preface This article uses the new features of MyS...