Mysql 8.0 installation and password reset issues

Mysql 8.0 installation and password reset issues

Mysql 8.0 installation problems and password reset

1: Download MySql

Official website download address: https://dev.mysql.com/downloads/mysql/


Website home page drop down
Select the system, click the Download button, and save the compressed file to the installation path.

2: Install MySql

Open the downloaded file and unzip it to the specified directory.

Open the unzipped MySql file and create my.ini (mysql configuration file) in the root directory. Use nodpad++c to create

Here you need to change the basedir and datadir paths to the mysql decompression path

[mysql]
# Set the default character set of the mysql client to default-character-set=utf8
[mysqld]
#Set port 3306 port = 3306
# Set the installation directory of mysql basedir=C:\Program Files\Java\mysql-8.0.12-winx64\mysql-8.0.12-winx64
# Set the storage directory of mysql database data datadir=C:\Program Files\Java\mysql-8.0.12-winx64\mysql-8.0.12-winx64\datadir
# 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
skip-grant-tables

Find the CMD command prompt

Enter the mysql subdirectory bin

Enter in sequence: mysqld --install (install)

mysqld --initialize (Initialization)
net start mysql (run) 

insert image description here
I have completed the installation here. This machine is Apple Windows 7 and has only one C drive, so it can only be installed in the C path.

3: Change password

Because the latest version of MySQL 8.0 is downloaded, it comes with a password and must be reset when used.


insert image description here

Use administrator privileges to enter mysql, the system requires a password.

The original password is in the .err file in C:\Program Files\Java\mysql-8.0.12-winx64\mysql-8.0.12-winx64\data.

Open .err, the password is on this line of the file.

insert image description here

Type the password into enter password in cmd.

Testing will report an error

insert image description here

Insert command to change password

alter user 'root'@'localhost' identified with mysql_native_password by 'your password';

Prompt Query OK

Test using database:

insert image description here

Note that the database statement must end with a semicolon, otherwise it will not be executed and -> will appear continuously.

Summarize

The above is the MySQL 8.0 installation and password reset issues 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!

You may also be interested in:
  • Tutorial on installing the latest MySQL 8.0.18 using a compressed package on Win10 64-bit (with pictures and text)
  • MySQL 8.0.11 compressed version installation and configuration method graphic tutorial
  • MySQL 8.0.11 compressed version installation tutorial
  • MySQL compressed package installation and configuration method graphic tutorial
  • Complete steps to reset the root user password in mysql8
  • How to reset the root password in mysql8.0.12
  • How to reset MySQL root password under Windows
  • Detailed method for forgetting the root password or resetting the password in Mysql 5.7
  • How to reset the MySQL password after forgetting it in Mac operating system
  • What should I do if I forget my MySQL password? How to reset MySQL root password
  • Pitfalls encountered when installing MySQL 8.0.18 compressed package and resetting forgotten passwords

<<:  How to detect whether a file is damaged using Apache Tika

>>:  How to set up the terminal to run applications after Ubuntu starts

Recommend

HTML table tag tutorial (46): table footer tag

The <tfoot> tag is used to define the style...

Detailed explanation of fs module and Path module methods in Node.js

Overview: The filesystem module is a simple wrapp...

Implementation of remote Linux development using vscode

Say goodbye to the past Before vscode had remote ...

Win10 + Ubuntu20.04 LTS dual system boot interface beautification

Effect display The built-in boot interface is too...

11 Examples of Advanced Usage of Input Elements in Web Forms

1. Cancel the dotted box when the button is press...

CentOS8 network card configuration file

1. Introduction CentOS8 system update, the new ve...

Detailed Tutorial on Installing MySQL 5.7 on RedHat 6.5

RedHat6.5 installation MySQL5.7 tutorial sharing,...

js to achieve the effect of dragging the slider

This article shares the specific code of how to d...

MySQL Optimization: Cache Optimization

I am happy that some bloggers marked my article. ...

Mysql experiment: using explain to analyze the trend of indexes

Overview Indexing is a skill that must be mastere...

Write your HTML like this to make your code more compatible

For example, users who need screen reading softwar...

A brief comparison of Props in React

Table of contents Props comparison of class compo...

WeChat applet realizes the nine-square grid effect

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

Solution to mysql login warning problem

1. Introduction When we log in to MySQL, we often...