【发布时间】:2022-01-10 11:11:11
【问题描述】:
我在我的 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但没有任何改变。
但是问题没有解决,我也没有找到任何方法来解决这个问题。
【问题讨论】:
标签: phpmyadmin sequelpro laravel-sail