Preface Readers who are familiar with MySQL may find that MySQL is updated very quickly. In terms of installation, MySQL provides two classic installation methods: decompression and one-click. Although there are two installation methods, I prefer the decompression installation, which is not only fast but also clean. In terms of operating system, MySQL also supports multiple types of operating systems, such as Linux, Windows, etc. The following are several operating systems with major changes in MySQL. Through research and analysis, it is not difficult to find that: as MySQL iterates from low versions to high versions, increasingly rigorous security is one of its major features. For example, before version 6, when you forget your password, it is very convenient to reset it. You only need to perform the following two steps: Step 1: Skip the permissions table mysqld --skip-grant-tables Step 2: Leave the password blank UPDATE user SET authentication_string='' WHERE user='root'; However, this solution is not applicable to MySQL 8. This article will solve the problem of resetting the password if you forget the MySQL 8 password. It mainly includes three aspects Content 1: Briefly describe the decompression installation of MySQL 8 Content 2: Forgot your password and reset it Solution 1 Content 3: Forgot your password and reset it Solution 2 One installation 1. Download the installation package from the official website (the official website provides two installation methods: visual installation and decompression). This example is based on the decompression method. Official website download address: https://dev.mysql.com/downloads/mysql/ 2. Unzip the installation package and put it in the C:\MySQL directory 3. Configure environment variables
4. Open DOS as an administrator (1) Start the service mysqld --install (2) Initialize and generate an initialization password (MySQL 7+ does not have a data directory, so the data directory is installed initially) mysqld --initialize --user=mysql --console (3) Start the service net start mysql (4) Log in Account root, password is the temporary password A*v)(Ivw7xjQ generated by the initial session, which needs to be changed after logging in (5) Change the root password Format: alter user 'user name'@'login host' identified by 'password (custom)'; (6) Log in with new password (7) Extended commands Remove service: mysql --remove Stop the mysql service: mysql stop mysql Exit mysql:exit 2. Solve the problem of forgetting password (I) Plan 1 1. Enter DOS as an administrator 2. Stop the mysql service net stop mysql 3. Start without password mysqld --console --skip-grant-tables --shared-memory 4. Open another DOS window and log in without a password 5. Clear password Note: authentication_string uses plugin encryption, so set it to empty and do not set it to other values. 6. Start the service Close the two open DOS windows, then reopen a DOS window as an administrator and start the service net start mysql 7. Password-less login mysql -u root 8. Reset your password After modification, you can log in with the new password. 9. Log in with new password (II) Solution 2: Using the --init-file parameter 1. Stop the service net stop mysql 2. Create the ResetPWD.txt file in the c:\MySQL directory. The content of the file is ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'; 3. Execute the ResetPWD.txt file mysqld --init-file=c:\mysql\ResetPWD.txt --console, after execution, close the DOS window 4. Start mysql net start mysql 5. Log in with your new password Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM. You may also be interested in:
|
<<: Solve the cross-domain problem of Vue+SpringBoot+Shiro
>>: How to implement Docker Registry to build a private image warehouse
Although the frequency of starting the shell is v...
Base image The base image has two meanings: Does ...
Pop-up news is common in domestic Internet servic...
By default, Nginx supports only one SSL certifica...
Sometimes our pages will need some prompt boxes o...
Preface Two types of swap space can be created un...
1. Download related tools and images Download Lin...
Preface The string types of MySQL database are CH...
Introduction to Jib Jib is a library developed by...
Recently, a system was deployed, using nginx as a...
This article describes the steps to install the p...
The methods of installing nginx and multiple tomc...
At the end of last year, I replaced the opensuse ...
Preface Reduce is one of the new conventional arr...
1 Background Recently, some performance issues ha...