MySQL 5.7.19 installation tutorial under Windows 10 How to change the root password of MySQL after forgetting it

MySQL 5.7.19 installation tutorial under Windows 10 How to change the root password of MySQL after forgetting it

Take MySQL 5.7.19 installation as an example, first download

Of course, the first thing to do is to download https://dev.mysql.com/downloads/mysql/ official website download address.

Select the version suitable for your computer, click Download, jump, and download directly.

Quietly wait for downloading and decompression. This is my decompression path D:\MySQL

Officially start installation

: Windows 10

:MySQL5.7.19

After decompression

However, there is no my.ini, so just create one. Create a new text document->change the suffix to ini.

[Client]
#Set port 3306 port = 3306
[mysqld]
#Set port 3306 port = 3306
# Set your own MySQL installation directory basedir=D:\MySQL
# Set the storage directory of your MySQL database data datadir=D:\MySQL\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
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
# Set the client's default character set default-character-set=utf8

Then the next step is to configure the environment variables, just go to the picture above.

This computer -> right click, properties -> advanced system settings -> environment variables

Variable Name: MYSQL_HOME

Variable value: your own MySQL installation path

Next, add Path, select Path Edit, and add a new one: %MYSQL_HOME%\bin

All the way sure.

To open the command prompt, you must have administrator privileges, otherwise you will not have enough privileges.

cd /dD:\MySQL\bin to enter the bin directory. Go to the bin directory! It’s not written on the picture! Then press the command as shown in the picture.

Next, enter MySQL using mysql -u root -p. No password is required for the first entry, just press Enter. Because I installed it before, it requires a password.

Next update the password

MySQL 5.7 no longer has the PASSWORD field, which has been changed to authentication_string

SO:

mysql>update mysql.user set anthentication_string=password('your password') where user='root';

mysql>flush privileges; //Refresh MySQL system privileges

mysql>quit;

Enter mysql -u root -p again and you can operate.

mysql>show databases;

You can also download a MySQL graphical interface, such as SQLyog, Navicat, etc.

Forgot root password

Maybe you will forget your password after a while.

See picture.

First, use net stop mysql to stop the service;

If you can’t stop:

Press Ctrl+Alt+Del to open the Task Manager and end the mysql.exe task in the details.

Enter the bin directory

mysqld -nt --skip-grant-tables

Now this command prompt is no longer usable.

Reopen an administrator command prompt, enter mysql, and change the password again.

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:
  • Detailed tutorial for installing mysql5.7.21 under Windows
  • Detailed tutorial for installing mysql5.7.21 under Windows system
  • Tutorial on installing mysql5.7.17 on windows10
  • MySQL 5.7 installation tutorial (windows)
  • Detailed graphic tutorial on how to install the unzipped version of MySQL under Windows 10
  • How to install and configure MySQL 8.0.12 decompressed version under Windows 10 with graphic tutorials
  • How to install and uninstall MySQL service under Windows (MySQL 5.6 zip decompression version installation tutorial)
  • Detailed tutorial for installing the unzipped version of mysql5.7.28 winx64 on windows

<<:  WeChat applet uses the video player video component

>>:  VMware workstation 12 install Ubuntu 14.04 (64 bit)

Recommend

Vue.js front-end web page pop-up asynchronous behavior example analysis

Table of contents 1. Preface 2. Find two pop-up c...

Docker custom network implementation

Table of contents 1. Customize the network to rea...

How to change mysql password under Centos

1. Modify MySQL login settings: # vim /etc/my.cnf...

Detailed explanation of MySQL slow log query

Slow log query function The main function of slow...

React.js framework Redux basic case detailed explanation

react.js framework Redux https://github.com/react...

25 CSS frameworks, tools, software and templates shared

Sprite Cow download CSS Lint download Prefixr dow...

In-depth understanding of MySQL global locks and table locks

Preface According to the scope of locking, locks ...

MySQL trigger syntax and application examples

This article uses examples to illustrate the synt...

Detailed explanation of how to solve the problem of too long content in CSS

When we write CSS, we sometimes forget about the ...

Complete steps to implement face recognition login in Ubuntu

1. Install Howdy: howdy project address sudo add-...

MySQL sorting Chinese details and examples

Detailed explanation of MySQL sorting Chinese cha...

Solution to the error when installing Docker on CentOS version

1. Version Information # cat /etc/system-release ...

Vue achieves seamless carousel effect

This article shares the specific code of Vue to a...