Summary of the installation process of MySql 8.0.11 and the problems encountered when linking with Navicat

Summary of the installation process of MySql 8.0.11 and the problems encountered when linking with Navicat

My system and software versions are as follows:

System environment: win7, 64 bit

MySQL version: 8.0.11

Notes on the version

The reason why it is MySQL 5.7 and above is that its security mechanism has changed since MySQL 5.7. After the installation is complete, you need to enter a password when logging in to MySQL. This password is actually a random password generated during the MySQL configuration process, and we must find this random password to log in to MySQL. This is not necessary for versions prior to 5.7, so this tutorial may not be completely applicable to versions prior to 5.7. However, there are many tutorials online, so you can search for them yourself if necessary.

System environment

Win10, 64-bit

MySQL version

8.0.11 Free Installation Version

MySQL download address: https://dev.mysql.com/downloads/mysql/

Scroll down on the download page, select your operating system version and bit number, and then download it.

MySQL Installation

Since the MySQL selected here is a free installation version, decompression is installation. Just decompress MySQL to the location you want.

Environment Configuration

1. Add the path of the bin directory after MySQL is unpacked in 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, right-click the mouse, and select Command Prompt (Administrator) (A)), enter D:, and then press Enter to enter the D drive (the drive where MySQL is unzipped)

3. Continue to enter 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
4. Install MySQL and enter the following command

mysqld -install 

Notice:

1. If the message "mysqld is not recognized as an internal or external command, operable program or batch file" appears in this step, in my personal experience, it is because there is no mysqld.exe application in the bin directory. The reason for this may be that the version is wrong, or the versions are the same.

But the downloaded one has the words "Debug Binaries & Test Suite" and there is no mysqld.exe in the bin.

2. By the way, the command to remove the MySQL service is: mysqld -remove

5. Then enter:

mysqld --initialize

1. Then press Enter (you may need to wait for a while). A data folder will be generated in the root directory of MySQL. Note that there is a file ending with .err in it. The initial password is in this file (you can press Ctrl+F to search for password to find the password). This initial password will be used later.

6. Configure the MySQL startup file

1. If there is a file named my-default.ini in the decompressed MySQL, enter the following items in the configuration file:

basedir=D:\mysql-8.0.11-winx64
datadir=D:\mysql-8.0.11-winx64\data
port=3306

Notice:

1. The path and name here still need to be consistent with your computer

2. If there is no file named my-default.ini in the decompressed MySQL, create a new file named my.ini in the root directory, select the file, right-click, choose to open with Notepad, and enter:

basedir=D:\mysql-8.0.11-winx64
datadir=D:\mysql-8.0.11-winx64\data
port=3306

After completing the input, click Save and Close.

7. Start the MySQL service: Enter the MySQL bin directory (after the previous steps, you are now in the MySQL bin directory), and enter:

net start mysql

8. Log in to MySQL and enter the following command:

mysql -u root -p

As can be seen from the above picture, we are required to enter a password here. This password is the initial password automatically generated by MySQL, which has been mentioned in step 5 above. Find the file ending with .err, open it with Notepad, and search for password in the file. You will see the following search results. The part in the red box is the initial password (the password generated by each user is different, just find your own one)

Copy this initial password and enter it in cmd. If you see the interface shown below, it means that MySQL has been configured successfully.

9. Change the initial password

In order to facilitate password memorization and for security reasons, we can reset the MySQL login password. After successfully completing step 8, we then enter

set password for root@localhost=password('xxxxxx');

Notice:

The xxxxxx in single quotes represents the password you set, which can be changed by yourself

The semicolon after the statement also needs to be entered. If you do not enter it the first time, you can enter the semicolon again after pressing Enter.

The format for changing passwords is different in different versions, although they are all versions 5.7 and above. For example, for version 8.0.11, the format for changing passwords is: ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxx';, where xxxxxx represents the password you want to set.

If you don't know what format to use, you can enter the use mysql; command after logging in with the initial password and before changing the initial password. The system will then prompt you to change the initial password before you can continue to use it. This prompt will mention what format to use to change the password. Of course, we will only tell you the keywords here, but with this keyword, we can get its complete syntax format from Baidu.

If the password is set successfully, the following interface will appear:

10. Exit MySQL: Then enter

quit

11. Log in with the new password (must be in the bin directory of MySQL), enter

mysql -u root -p

1. Then enter the new password you just set, press Enter, and the login is successful

At this point, MySQL has been configured successfully and the initial password has been changed. You can use it as much as you want!

The above method is feasible

After the installation and configuration were completed, I found a problem when I wanted to connect to the local database through Navicat

1. Navicat reports error 2059 when connecting to MySQL database

Explanation: It is said that the encryption rule in versions before MySQL 8 is mysql_native_password, and after MySQL 8, 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 encryption rule of the MySQL user login password to mysql_native_password. Now let's talk about the second way.

Command line to enter MySQL database

Enter the following command, line by line, and add a carriage return after each line

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 the user's password FLUSH PRIVILEGES; #Refresh permissions

Just like this

5. Then it should be OK, I wish you good luck.

6.Tips: The "password" used in the command line is the updated database password. You can change it to the password you want, such as "123" or something like that. Then use Navicat to connect to MySQL successfully. It has been tested and works! ! !

Summarize

The above is the editor's introduction to the MySql 8.0.11 installation process and the problems encountered when linking Navicat. 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. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Navicat Premium15 installation and cracking tutorial detailed explanation of personal test and effectiveness (with cracking failure solution)
  • Navicat Premium 15 permanent crack activation tool and installation tutorial (professional test available)
  • Detailed explanation of the idea of ​​installing mysql8.0.11 and changing the root password and connecting navicat for mysql
  • Solution to 1044/1045 error when installing Navicat in MySQL
  • Navicat15 installation tutorial super detailed steps (most reliable)

<<:  Troubleshooting ideas and solutions for high CPU usage in Linux systems

>>:  Sample code for implementing history in vuex

Recommend

Detailed explanation of MySQL solution to USE DB congestion

When we encounter a fault, we often think about h...

Implementing a puzzle game with js

This article shares the specific code of js to im...

Detailed explanation of custom instructions for Vue.js source code analysis

Preface In addition to the default built-in direc...

Draw an iPhone based on CSS3

Result:Implementation Code html <div class=...

How to Monitor Linux Memory Usage Using Bash Script

Preface There are many open source monitoring too...

Mysql sets boolean type operations

Mysql sets boolean type 1. Tinyint type We create...

Master the commonly used HTML tags for quoting content in web pages

Use blockquote for long citations, q for short ci...

Example of implementing QR code scanning effects with CSS3

Online Preview https://jsrun.pro/AafKp/ First loo...

Example of implementing TikTok text shaking effect with CSS

In daily development, front-end students often ar...

Share some uncommon but useful JS techniques

Preface Programming languages ​​usually contain v...

New ideas for time formatting in JavaScript toLocaleString()

Table of contents 1. Conventional ideas for time ...

JavaScript static scope and dynamic scope explained with examples

Table of contents Preface Static scope vs. dynami...

How to import CSS styles into HTML external style sheets

The link-in style is to put all the styles in one...

WeChat applet realizes linkage menu

Recently, in order to realize the course design, ...