【发布时间】:2018-08-11 01:40:41
【问题描述】:
我正在尝试为我的 MySQL 数据库设置一个远程用户,以便我可以从任何 IP 访问它。 MySQL 服务器托管在 Ubuntu VPS 服务器上。
我已经创建了一个远程用户,你可以在这里看到:
login as: root
root@xx.xx.xx's password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-108-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
82 packages can be updated.
42 updates are security updates.
Last login: Fri Mar 2 19:47:15 2018 from xxxxxxx
root@vpsxxxxxx:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.7.21-0ubuntu0.16.04.1 (Ubuntu)
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> SHOW variables WHERE Variable_name = 'hostname' OR Variable_name = 'port';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| hostname | vps520749 |
| port | 3306 |
+---------------+-----------+
2 rows in set (0.01 sec)
mysql> SELECT Host,User from mysql.user;
+-----------+------------------+
| Host | User |
+-----------+------------------+
| % | user |
| localhost | debian-sys-maint |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
5 rows in set (0.00 sec)
mysql>
但是,一旦我尝试通过 Navicat 或 MySQL Workbench 以用户 user 登录,我就会收到此错误:
即使我尝试通过 SSH 连接到 SQL 服务器,我仍然会收到错误:
顺便说一下,我的连接设置:
我在这里错过了什么?
【问题讨论】:
标签: mysql ssh remote-access ubuntu-server navicat