In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces you how to install mysql8.0.11 and modify the root password, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1.1. Download the zip package:
1.3. Generate the data file:
Run cmd as an administrator
Program-enter cmd to find the right cmd.exe and run as an administrator
Enter E:\ web\ mysql-8.0.11\ bin
Execute the command: mysqld-- initialize-insecure-- user=mysql generates the data directory under the E:\ web\ mysql-8.0.11 directory
1.4. Start the service:
Execute command: net start mysql starts the mysql service, if prompted: the service name is invalid. (see step 1.5)
1.5. Resolve the failure to start the service (error):
Hint: invalid service name
Solution:
Execute command: mysqld-install (do not need my.ini configuration file Note: many things written on the Internet need my.ini configuration file, but in fact, you don't need my.ini configuration file. I placed the my.ini file before, but prompted that the service could not be started. After deleting my.ini, it started successfully)
If there is a prompt that "the service is starting or stopping, please try again later", you need to go to the Explorer to finish the mysql process and restart it.
1.6. Log in to mysql:
Log in to mysql: (because the password has not been set before, the password is empty. You do not need to enter the password, you can enter directly.)
E:\ mysql-5.7.20-winx64\ bin > mysql- u root-p
Enter password:
1.7. Query user password:
Query user password command: mysql > select host,user,authentication_string from mysql.user
Host: the ip' location'% where the user is allowed to log in indicates that it can be remotely
User: the user name of the current database
Authentication_string: user password (this field is mentioned later)
1.8. Set (or modify) the root user password:
If the default root password is empty, we will not be able to connect using navicat, so we need to change the root password.
This is a crucial step. I stepped on N many holes here, and later I checked a lot of them to know that the password field and password () function were abandoned after mysql 5.7.9; authentication_string: the field represents the user's password.
The following steps directly demonstrate the correct modification of the root password:
First, if there is content under the authentication_string field of the current root user, set it to empty first, otherwise proceed directly to two steps.
Use mysql; update user set authentication_string='' where user='root'
3. The following steps directly demonstrate the correct modification of the root password:
Second, use ALTER to modify the root user password, the method is ALTER user 'root'@'localhost' IDENTIFIED BY' new password'. As follows:
ALTER user 'root'@'localhost' IDENTIFIED BY' Cliu123#'
There are two points to note here:
1. Flush privileges is not required to refresh permissions.
2. The password should contain uppercase letters, lowercase letters, numbers and special symbols.
Modified successfully; log in with username and password again
Note: the password must not be taken in the following form:
Use mysql; update user set authentication_string= "newpassword" where user= "root"
This sets the newpassword value under the authentication_string field of the root user in the user table
There will be an error when using ALTER USER 'root'@'localhost' IDENTIFITED BY' newpassword' again.
Because the authentication_string field can only be the 41-bit string password after mysql encryption; others will report incorrect format.
* THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE
At this point, the installation of mysql and the change of root password are over.
Start the navicat for mysql article.
The account password is correct, and the connection error is 1251. OK, let's first take a look at this change:
Before MySQL 8.04, execute: SET PASSWORD=PASSWORD ('[new password]'); but start with MySQL8.0.4, which is not allowed by default. Because before, the password authentication plug-in for MySQL was "mysql_native_password", but now it is "caching_sha2_password".
So, we need to change the root password again.
Log in to the mysql environment first: execute the following three commands. (remember to put a semicolon)
Use mysql;ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' new password; FLUSH PRIVILEGES; on how to install mysql8.0.11 and change the root password to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.