In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to solve the MySQL8.0 installation of the first login to change the password of the problem, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.
Next, I would like to introduce mysql 8.0.16 to change your password for the first time.
The password needs to be changed for the first login after mysql database initialization.
You will encounter the following error when you log in for the first time
Ql > alter user root identified by 'password'
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
You need to use the following command to change the password
Mysql > alter user user () identified by 'password';Query OK, 0 rows affected (1.43 sec)
Ps: let's take a look at the problems when installing MySQL8.0 + logging in for the first time + changing your password
Installation
Because it was installed before but on disk C, this time I want to move it to disk D, so I deleted all the parts I installed before and left the MySQL Installer file for installation. There is a very bad place, that is, its installation directory is on disk C by default, if you want to change the directory, then Choosing a Setup Type that step should pay attention to select the Custom custom installation item.
Then go on here and choose the project you want to install. For example, I'll just choose one here.
At this time, you do not see any option to change the installation directory, you need to select the thing you want to install, and then there will be an extra link in the lower right corner. Click it to change the installation directory.
It is important to note that if there are multiple things you want to install, you need to click on each of them and change their installation path one by one.
However, there is still a problem. This prompt may appear when you change the directory.
I don't understand why, but the solution is to keep its original path name and only change or add it in front of the path, such as this.
The latter configuration is mainly to pay attention to the setting of the port number, the default is 3306, but if there is a conflict, the port is already occupied, it can be changed to between 3306 and 3309.
After installation, remember to set variables in the system environment variable Path to facilitate cmd.
Landing for the first time
There are many problems encountered, such as opening cmd and executing the first step.
Net start MySQL
Report an error.
The reason is that cmd is not running as an administrator
After running as an administrator, there is another problem.
For the first time, I don't know why there is this problem. I found a solution on the Internet and need to initialize it.
Mysqld-initialize
After the service starts, run
Mysql-u root-p
And then I'll ask you to enter your password. There's another problem here.
This hint means the password is wrong.
I am also a bit obsessed with this place. Obviously, when I installed MySQL, I asked you to set a password, but in fact, that password didn't seem to be needed. What I should enter in this place is the random initial password it generated automatically, and this initial password is placed in an .err file under the MySQL installation directory with the secret code. It's not hard to find, it seems to be the only .err type file in the whole folder, just search in the folder.
The content of the file is not long, find this paragraph of text, the following line is the initial password.
Enter the password and show that this is a success.
Modify the password
MySQL8.0 later change the password is not the same as before, many of the previous methods will report errors if you use it now, it is feasible to test the following code
ALTER USER "root" @ "localhost" IDENTIFIED BY "your new password"; thank you for reading this article carefully. I hope the article shared by the editor on "how to solve the problem of changing your password when logging in for the first time in MySQL8.0 installation" is helpful to everyone. At the same time, I also hope you can support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.