Home > Database > navicat > body text

How to connect Navicat to MySQL8.0 (effective)

不言
Release: 2018-09-29 16:25:31
forward
6789 people have browsed it

The content of this article is about the method of connecting Navicat to MySQL8.0 (effective). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

I downloaded MySQL 8.0 today and found that Navicat could not connect and always reported error 1251;

The reason is that the encryption method of MySQL 8.0 version is different from that of MySQL 5.0 , the connection will report an error.

After trying many methods, I finally found one that can be implemented:

Change the encryption method

1. First enter the mysql root account through the command line:

PS C:\Windows\system32> mysql -uroot -p
Copy after login

Then enter the root password:

Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 8.0.11 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Copy after login

2. Change the encryption method:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.10 sec)
Copy after login

3. Change the password:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Query OK, 0 rows affected (0.35 sec)
Copy after login

4. Refresh:

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.28 sec)
Copy after login

// If an error is reported ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'%':

The remote access permission is not Correct, select the database first, check it and then change it:

mysql> use mysql;
Database changed

mysql> select user,host from user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
rows in set (0.00 sec)
Copy after login

The above is the detailed content of How to connect Navicat to MySQL8.0 (effective). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!