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

Vue uses mockjs to generate simulated data case details

Table of contents Install mockjs in your project ...

Sample code for implementing Google third-party login in Vue

Table of contents 1. Developer Platform Configura...

Implementation of the login page of Vue actual combat record

Table of contents 1. Preliminary preparation 1.1 ...

The benefits of div+css and web standard pages

The div element is used to provide structure and b...

How to print highlighted code in nodejs console

Preface When the code runs and an error occurs, w...

HTML table tag tutorial (25): vertical alignment attribute VALIGN

In the vertical direction, you can set the row al...

Solution to Linux QT Kit missing and Version empty problem

Currently encountering such a problem My situatio...

Detailed explanation of using JavaScript WeakMap

A WeakMap object is a collection of key/value pai...

WeChat applet implements the Record function

This article shares the specific code for the WeC...

Mysql dynamically updates the database script example explanation

The specific upgrade script is as follows: Dynami...

Turn off the AutoComplete function in the input box

Now we can use an attribute of input called autoco...

Analysis of Sysbench's benchmarking process for MySQL

Preface 1. Benchmarking is a type of performance ...

my.cnf parameter configuration to optimize InnoDB engine performance

I have read countless my.cnf configurations on th...

MySQL 5.7.11 zip installation and configuration method graphic tutorial

1. Download the MySQL 5.7.11 zip installation pac...