简体   繁体   English

无法通过数字海洋上的 Sequel Pro 连接到 sql server

[英]Can't connect to sql server via Sequel Pro on digital ocean

I want to connect to my database server, hosted on digital ocean.我想连接到我的数据库服务器,托管在数字海洋上。 Therefore I configured my Sequel Pro setup like this:因此,我像这样配置了我的 Sequel Pro 设置:

在此处输入图片说明

The error I get is:我得到的错误是:

在此处输入图片说明

on my server the port 3306 is allowed via `ufw allow 3306/tcp' and the ufw service has been restarted.在我的服务器上,通过“ufw allow 3306/tcp”允许端口 3306,并且 ufw 服务已重新启动。 Still I cannot connect.我仍然无法连接。 I am asked for my password for the SSH service, which works, but then the error arises.我被要求输入 SSH 服务的密码,该服务有效,但随后出现错误。 Where do I need to reconfigure my settings?我需要在哪里重新配置我的设置?

If you know the current MySQL password then connect with it by the terminal .如果您知道当前的MySQL密码,则通过terminal连接它。 After that run this command之后运行此命令

SELECT user,authentication_string,plugin,host FROM mysql.user;

you maybe get something similar你可能会得到类似的东西

mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
+------------------+-------------------------------------------+-----------------------+-----------+
| user             | authentication_string                     | plugin                | host      |
+------------------+-------------------------------------------+-----------------------+-----------+
| root             |                                           | auth_socket           | localhost |
| mysql.session    | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost |
| mysql.sys        | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost |
| debian-sys-maint | *EFBDB02467A8AB572944B873296089BB6607492C | mysql_native_password | localhost |
+------------------+-------------------------------------------+-----------------------+-----------+
4 rows in set (0.00 sec)

s you can see, the plugin is auth_socket, which is causing the issue.您可以看到,插件是 auth_socket,这是导致问题的原因。 Let's update it to use the root password让我们更新它以使用 root 密码

'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'DO_PASSWORD_HERE';

Then flush the privileges to have the updates take effect.然后刷新权限以使更新生效。

FLUSH PRIVILEGES;

Then exit;然后exit; and restart the MySQL service mysql restart并重启 MySQL service mysql restart

Everything should work now :)一切都应该现在工作:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM