MySQL 5.7.17 installation and configuration method graphic tutorial (windows10)

MySQL 5.7.17 installation and configuration method graphic tutorial (windows10)

MySQL 5.7.17 installation and configuration method summary

The first step is to download mysql-5.7.17-winx64.zip from the MySQL official website

The second step is to decompress mysql-5.7.17-winx64.zip

The third step is to create a new my.ini file , then open it with Notepad and enter the basic configuration of MySQL:

[mysql]
; Set the mysql client default character set default-character-set=utf8
[mysqld]
; Set port 3306 port = 3306 
; Set the mysql installation directory basedir=E:\mysql5.7
; Set the storage directory of mysql database data datadir=E:\mysql5.7\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 


Step 4: After opening the cmd window as an administrator, switch the directory to the bin directory of your unzipped file. Then enter mysqld install and press Enter to run it. Note that it is mysqld, not mysql.

Step 5 Next, we use mysqld --initialize to initialize the data directory. Otherwise, there will be no data folder under the mysql5.7 folder.

The sixth step is to start the service by entering net start mysql . net stop mysql stops the mysql service

Step 7

(1) After MySQL 5.7 is installed, a random password will be generated in the root directory when it is started for the first time. The file name is .mysql_secret
Therefore, you need to log in with a random password, and then modify the password through the following command: " SET PASSWORD = PASSWORD('new password'); "

(2). When you forget your root password,

Take Windows as an example:

1. Shut down the running MySQL service.

2. Open a DOS window and go to the mysql\bin directory

3. Enter mysqld --skip-grant-tables and press Enter
--skip-grant-tables means skipping the permission table authentication when starting the MySQL service.

4. Open another DOS window (because the previous DOS window cannot be moved) and go to the mysql\bin directory.

5. Type mysql and press Enter. If successful, the MySQL prompt > will appear.

6. Connect to the privilege database: use mysql; (don’t forget to add a semicolon at the end).

7. Change the password: update user set password=password("123") where user="root"; (don’t forget to add a semicolon at the end).

If the password change appears
**mysql password change error ERROR 1054 (42S22)**

Then use mysql>update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost';
Or update MySQL.user set password=PASSWORD('123456') where User='root';

8. mysql>flush privileges ; #Update privileges

9. Exit quit.

10. Log out of the system and log back in.
Type mysql -u root -p
Log in using the username root and the new password 123456 you just set.

(3). When you know the root password

Method 1: Use the SET PASSWORD command to log in to MySQL first.
Format: mysql> set password for username@localhost = password('new password');
Example: mysql> set password for root@localhost = password('123');

Method 2: Using mysqladmin
Format: mysqladmin -u username -p old password password new password Example: mysqladmin -uroot -p123456 password 123

Method 3: Use UPDATE to directly edit the user table First log in to MySQL.

mysql> use mysql; 
 mysql> update user set password=password('123') where user='root' and host='localhost'; 
mysql> flush privileges;

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:
  • Windows10 x64 installation and configuration of Oracle 11g process record (graphic tutorial)
  • How to install Docker on Windows 10
  • Tutorial on installing mysql5.7.18 on windows10
  • Graphic tutorial for installing MySQL 5.6.35 on Windows 10 64-bit
  • MySQL 5.7.17 installation and configuration method graphic tutorial under Windows 10
  • Tutorial on installing mysql5.7.17 on windows10
  • Tutorial on installing python3.x+scrapy in windows10 system
  • Windows Server 2016 Server Configuration Guide: MariaDB Database Environment Construction Method
  • Tutorial on installing MariaDB on Windows 10

<<:  js implements random roll call

>>:  Nginx proxy forwarding implementation code uploaded by Alibaba Cloud OSS

Recommend

Use of kubernetes YAML files

Table of contents 01 Introduction to YAML files Y...

How to create a test database with tens of millions of test data in MySQL

Sometimes you need to create some test data, base...

Complete step record of vue encapsulation TabBar component

Table of contents Implementation ideas: Step 1: C...

A complete record of a Mysql deadlock troubleshooting process

Preface The database deadlocks I encountered befo...

CSS tips for controlling animation playback and pause (very practical)

Today I will introduce a very simple trick to con...

Import backup between mysql database and oracle database

Import the data exported from the Oracle database...

Sample code for batch deployment of Nginx with Ansible

1.1 Copy the nginx installation package and insta...

10 reasons why Linux is becoming more and more popular

Linux has been loved by more and more users. Why ...

React internationalization react-intl usage

How to achieve internationalization in React? The...

Example of how to enable Slow query in MySQL

Preface Slow query log is a very important functi...