In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
My system and software versions are like this:
System environment: win7, 64 bit
MySQL version: 8.0.11
Description of the version
MySQL 5.7 and above is because its security mechanism has changed since MySQL 5.7. After installation, when logging in to MySQL, you need to enter a password. This password is actually a random password generated in the process of configuring MySQL, and we must find this random password to log in to MySQL. This is not required for versions prior to 5.7, so this tutorial may not be fully applicable for versions prior to 5.7, but there are many online, you can search for it yourself if you want.
system environment
Win10, 64 bit
MySQL version
8.0.11 installation-free edition
MySQL download address https://dev.mysql.com/downloads/mysql/
Scroll down on the download page, select your own operating system version and number of bits, and then download
MySQL installation
Since MySQL selected here is an installment-free version, decompression is installation, and MySQL can be decompressed to the location you want to put.
environment configuration
1. Add the path to the bin directory after MySQL decompression to the environment variable Path, for example, mine is: D:\mysql-5.7.20-winx64\bin
2. Run cmd as an administrator (place the mouse on the windows icon in the lower left corner of the screen, click the right mouse button, select Command Prompt (Administrator)(A)), enter D: , and then enter to enter D disk (the disk where MySQL is extracted).
3. Continue to the bin directory in MySQL and enter the following command:
cd mysql-8.0.11-winx64\bin
One thing to note here is:
1. The path and name here should be consistent with those on your computer.
To install MySQL, enter the following command:
mysqld -install
Note:
1. If mysqld is not an internal or external command, nor is it a runnable program or batch file, in my personal experience, it is because there is no mysqld.exe application in the bin directory, and the reason for not having this may be that the version is wrong, or the version is the same.
But download is with Debug Binaries & Test Suite words, with the word, bin inside is no mysqld.exe
By the way, the command to remove MySQL services is: mysqld -remove
5. Then enter:
mysqld --initialize
1, and then enter (may need to wait for a while), then in MySQL root directory will generate a data folder, note that there is a file ending with.err, the initial password is in this file (you can press Ctrl+F search password to find the password), this initial password will be used later
6. Configure MySQL startup files
1. If the extracted MySQL contains a file named my-default.ini, enter the following in the configuration file:
basedir=D:\mysql-8.0.11-winx64datadir=D:\mysql-8.0.11-winx64\dataport=3306
Note:
1. The path and name here still need to be the same as on your own computer
2. If there is no file named my-default.ini in MySQL after decompression, create a new file named my.ini in the root directory, then select the file, click the right mouse button, select Open with Notepad, and enter:
basedir=D:\mysql-8.0.11-winx64datadir=D:\mysql-8.0.11-winx64\dataport=3306
After the input is completed, click Save and close.
7. Start MySQL service: Enter MySQL bin directory (after the previous steps, it is now in MySQL bin directory), enter:
net start mysql
Log in to MySQL and enter the following command:
mysql -u root -p
As you can see from the above figure, we are asked to enter a password, which is the initial password automatically generated by MySQL, which has been mentioned in step 5 above. Find the file ending with.err, select Notepad to open, and then search for password in the file, you can see the following search results, the part out of the red box is the initial password (each user generates a different password, find your own)
Copy this initial password and enter cmd. If you see the interface shown in the figure below, MySQL has been configured successfully.
9. Modify the initial password
For convenience of remembering password and for security reasons, we can reset MySQL login password, after successfully completing step 8, we continue to enter
set password for root@localhost=password('xxxxxx');
Note:
xxxxxx in single quotes represents the password you set, you can change it yourself
The semicolon at the end of the statement also needs to be entered. If you don't enter it the first time, you can also enter the semicolon after the carriage return.
Different versions of the modified password format is different, although all are version 5.7 and above, for example, for this version of 8.0.11, the modified password format is: ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxx';, where xxxx represents the password you want to set
If you don't know what format to use, you can log in with the initial password, before modifying the initial password, enter the use mysql; command, then the system will prompt you to modify the initial password before continuing to use, in this prompt mentioned what format to use to modify the password, of course, here will only tell you the keyword, but with this keyword, its complete syntax format, we can get Baidu
If the password is set successfully, the interface shown in the figure below will appear:
10, exit MySQL: then enter
quit
11. Log in with the new password (must be in MySQL bin directory), enter
mysql -u root -p
1. Then enter the new password just set, enter, login successful
MySQL has been successfully configured and the initial password has been modified. You can use it as much as you like!
The above methods are feasible
I found a problem when I tried to link the local database through Navicat after the installation configuration was completed
Navicat error 2059 when connecting to MySQL database
Explain why: It is said that the encryption rule in the version before mysql8 is mysql_native_password, while after mysql8, the encryption rule is caching_sha2_password. There are two ways to solve the problem. One is to upgrade the navicat driver, and the other is to restore the mysql user login password encryption rule to mysql_native_password. Now for the second way.
Command line access to MySQL database
Enter the following commands, line by line, followed by a carriage return
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #Modify encryption rules ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';#Update user's password FLUSH PRIVILEGES; #Refresh permissions
like this
5. And then it should be okay, good luck.
6.Tips: The "password" used in the command line is the updated database password, which can be changed to the password you want to set, such as "123" or something, and then use Navicat to connect MySQL to connect successfully. Pro-test is available!!!
summary
The above is the MySql 8.0.11 installation process introduced by Xiaobian to you and the problems encountered when Navicat links. I hope to help you. If you have any questions, please leave a message to me. Xiaobian will reply to you in time. Thank you very much for your support!
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.