我在我的Laravel 8项目中使用Sail,但我找不到使用Sequel Pro查看我的数据库的方法。
当我运行./vendor/bin/sail up -d
时,我的容器运行良好,我可以使用以下凭据访问http://localhost:8080/中的PHPMyAdmin:
- 用户名:
sail
- 密码:
password
但问题是,当我尝试使用Sequel Pro时,我遇到了一个错误:
Connection failed!
Unable to connect to host 127.0.0.1, or the request timed out.
Verify that the address is correct and that you have the correct privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL returned: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen (/usr/local/lib/plugin/caching_sha2_password.so, 2): image not found
我在我的.env
中使用的凭据是:
- 主机:
127.0.0.1
- 用户名:
sail
- 密码:
password
- 端口:
3306
我尝试的: - 将主机从
127.0.0.1
更改为mysql
,就像我在.env
中所做的那样,但我得到以下错误:
Unable to connect to the mysql host, or the request timed out.
Verify that the address is correct and that you have the correct privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL returned: Unknown MySQL server host 'mysql' (0)
- 将端口从
3306
更改为8080
,但出现以下错误:
Unable to connect to host 127.0.0.1, or the request timed out.
Verify that the address is correct and that you have the correct privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL returned: Can't connect to MySQL server on '127.0.0.1' (4)
编辑:According to this article,问题似乎是从8.0版本开始,Mysql更改了与服务器连接的加密模式,并需要特定的插件来识别用户。
我找到了一些可以运行的命令来解决此问题,例如:
ALTER USER 'sail'@'server_ip' IDENTIFIED WITH mysql_native_password BY 'password';
但我得到这个错误Missing comma before start of a new alter operation
。SET PASSWORD FOR 'sail'@'server_ip' = 'password';
但它什么也没改变。./vendor/bin/sail down --rmi all -v
和./vendor/bin/sail up -d
,但它不会改变任何内容。
但问题还没有解决,我也找不到任何方法来解决这个问题。
1条答案
按热度按时间vsaztqbk1#
我没有修复Sequel Pro的问题,但是according to this article:
对于那些仍在为Sequel Pro问题而挣扎的人:Sequel Pro是一款很棒的产品,但由于存在大量未解决的问题,而且上一次发布是在2016年,因此寻找替代产品是一个不错的主意。SequelPro有一个分支,叫做SequelAce,它看起来非常稳定和最新,它保持了类似的功能,类似的外观和感觉,但同时它没有旧的Sequel Pro问题
所以我下载了Sequel Ace,一切都很好:https://github.com/Sequel-Ace/Sequel-Ace