Navicat connection MySQL 8.0 pro test

Today, the next MySQL 8.0 found that Navicat could not connect, and always reported 1251 errors;

After trying many ways, we finally found a way to achieve it:

By changing the encryption method:


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


PS C:\Windows\system32> mysql -uroot -p
Enter password: ******

Enter the password of root again:

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
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

2. Change encryption method:

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

3. Change the password again:

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

4. refresh:

Query OK, 0 rows affected (0.28 sec)

//If error 1396:

ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'%'

The remote access permission is incorrect. Check it and change it again, as follows:

mysql> select user,host from user;
| user             | host      |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
5 rows in set (0.00 sec)

//If error 1046:

mysql> select user,host from user;
ERROR 1046 (3D000): No database selected

Select the database first, and then run "select user,host from user;" to view:

mysql> use mysql;
Database changed

Tags: MySQL Oracle Database Navicat

Posted on Thu, 19 Mar 2020 10:50:04 -0700 by sid666