Navicat connection MySQL8.0 test

 

 

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

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

  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: ******
  After entering the root password 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
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
2. Change the 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:
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.28 sec)


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

  then your remote access permissions are incorrect, via

select  user , host from  user ;

  Check it out and change it 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 an error is reported:

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

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

mysql> use mysql;
Database changed

 

 

 

 

 

 

      

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325394173&siteId=291194637