navicat接続mysqlエラー1251ソリューション「親測定可能」
3563 ワード
今日はMySQL 8を降りました.0,Navicatが接続されていないことを発見して、いつも1251を間違えます;
理由はMySQL 8.0バージョンの暗号化方式とMySQL 5.0の違いは、接続が間違っています.
いろいろな方法を試して、やっと実現できるものを見つけました.
暗号化の変更
1.コマンドラインからmysqlへ
のrootアカウント:
?
1
rootのパスワードを入力します.
?
1
2
3
4
5
6
7
8
9
10
2.暗号化方式の変更:
?
1
2
3.パスワードの変更:この例では123が新しいパスワード
?
1
2
4.更新:
?
1
2
//エラーERROR 1396(HY 000):Operation ALTER USER failed for'root'@'%':
リモート・アクセス権限が正しくありません.まずデータベースを選択し、確認してから変更します.
?
1
2
3
4
5
6
7
8
9
10
11
12
13
理由はMySQL 8.0バージョンの暗号化方式とMySQL 5.0の違いは、接続が間違っています.
いろいろな方法を試して、やっと実現できるものを見つけました.
暗号化の変更
1.コマンドラインからmysqlへ
のrootアカウント:
?
1
PS C:\Windows\system32> mysql -uroot -p
rootのパスワードを入力します.
?
1
2
3
4
5
6
7
8
9
10
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>
2.暗号化方式の変更:
?
1
2
mysql>
ALTER
USER
'root'
@
'localhost'
IDENTIFIED
BY
'password'
PASSWORD
EXPIRE NEVER;
Query OK, 0
rows
affected (0.10 sec)
3.パスワードの変更:この例では123が新しいパスワード
?
1
2
mysql>
ALTER
USER
'root'
@
'localhost'
IDENTIFIED
WITH
mysql_native_password
BY
'123'
;
Query OK, 0
rows
affected (0.35 sec)
4.更新:
?
1
2
mysql> FLUSH
PRIVILEGES
;
Query OK, 0
rows
affected (0.28 sec)
//エラーERROR 1396(HY 000):Operation ALTER USER failed for'root'@'%':
リモート・アクセス権限が正しくありません.まずデータベースを選択し、確認してから変更します.
?
1
2
3
4
5
6
7
8
9
10
11
12
13
mysql> use mysql;
Database
changed
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)