Tutorial on configuring and changing passwords for the MySQL free installation version

Tutorial on configuring and changing passwords for the MySQL free installation version

Step 1: Configure environment variables (my decompression path: G:\mysql\mysql-5.7.21-winx64)

MYSQL_HOME = the path where you unzipped the file

PATH = ;%MYSQL_HOME%\bin;

The PATH variable is added on the basis of the original one, do not delete the other settings

The second step is to add the my.ini file in the unzipped directory (if this file already exists, just replace the content inside)

The file content is

[client]
 port=3306
 default-character-set=utf8
[mysqld]
 port=3306
 character_set_server=utf8
 #Unzip directory basedir=G:\mysql\mysql-5.7.21-winx64
 #Unzip the data directory datadir=G:\mysql\mysql-5.7.21-winx64\data
 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[WinMySQLAdmin]
 G:\mysql\mysql-5.7.21-winx64\bin\mysqld.exe 

Step 3: Run cmd as an administrator (search Baidu if you don’t understand), then enter the bin folder in the decompressed path, execute the mysqld -install command, and then create a data folder in the decompressed path (without content)

Step 4: Log in

Open cmd as an administrator, then enter mysql -uroot -p and press Enter without a password (the default password is empty)

Step 5: Change password

First, use net stop mysql to stop the mysql service, and then add a skip-grant-tables section to the my.ini file.

Then start the MySQL service and modify the authentication_string field value of the root user in the user table in the MySQL data source (originally the password field, later changed to authentication_string)


After success, delete the skip-grant-tables in the my.ini file and you're done.

If an error occurs:

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

It is because the password has expired. You can set it like this

set password = password('mysql');
use mysql
update user set password_lifetime = 0 where User='root';
flush privileges;

Summarize

The above is the tutorial on configuring and changing the password of the MySQL free installation 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:
  • MySQL 5.7 installation-free configuration graphic tutorial
  • Detailed tutorial on configuration method of Mysql 5.7.19 free installation version (64-bit)
  • MySQL 5.7.18 free installation version configuration tutorial
  • mysql5.7.18.zip Installation-free version configuration tutorial (windows)
  • MySQL installation and configuration tutorial for win10 free installation version
  • MySQL 5.7.17 free installation version configuration method graphic tutorial (windows10)
  • Mysql 5.7.17 winx64 free installation version, installation and configuration graphic tutorial under win10 environment

<<:  Example of how to configure nginx in centos server

>>:  React Synthetic Events Explained

Recommend

Two query methods when the MySQL query field type is json

The table structure is as follows: id varchar(32)...

Detailed steps to install JDK and Tomcat in Linux environment

Table of contents 1. Install JDK Manual Installat...

Build nginx virtual host based on domain name, port and IP

There are three types of virtual hosts supported ...

VUE introduces the implementation of using G2 charts

Table of contents About G2 Chart use Complete cod...

Docker custom network implementation

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

WeChat applet realizes the effect of swiping left to delete list items

This article shares the specific code for WeChat ...

Detailed explanation of MySQL execution plan

The EXPLAIN statement provides information about ...

Troubleshooting of master-slave delay issues when upgrading MySQL 5.6 to 5.7

Recently, when upgrading the Zabbix database from...

Detailed steps to install MySQL 5.7 via YUM on CentOS7

1. Go to the location where you want to store the...

MySQL scheduled task example tutorial

Preface Since MySQL 5.1.6, a very unique feature ...

Learn the key knowledge that must be mastered in the Vue framework

1. What is Vue Vue is a progressive framework for...

Vue computed properties

Table of contents 1. Basic Examples 2. Computed p...

MAC+PyCharm+Flask+Vue.js build system

Table of contents Configure node.js+nvm+npm npm s...

Thinking about grid design of web pages

<br />Original address: http://andymao.com/a...

What codes should I master when learning web page design?

This article introduces in detail some of the tech...