技术饭 WSL2使用PHP访问Windows 11上的MongoDB报错:Uncaught MongoDB\Driver\Exception\ConnectionTimeoutException: [connection refused calling hello on 'localhost:27017']

WSL2使用PHP访问Windows 11上的MongoDB报错:Uncaught MongoDB\Driver\Exception\ConnectionTimeoutException: No suitable servers found (`serverSelectionTryOnce` set): [connection refused calling hello on 'localhost:27017'],解决方法是:1、防火墙需要运行wsl2、2、mongodb配置文件设置bindIp=0.0.0.0、3、设置wsl中对应host访问

阅读全文 » 357天前
2023年05月28日

技术饭 本地开发环境nginx配置HTTPS,使用https证书

本地开发环境nginx配置HTTPS,使用https证书,我们访问的所有网站几乎都是受HTTPS保护的。如果你的站点还没有,那你应该使用它。使用HTTPS保护服务器也意味着你不能从不是HTTPS服务器向此服务器发送请求。这给使用本地开发环境的开发人员带来了一个问题,因为它们都运行在开箱即用的http://localhost环境中。

阅读全文 » 1257天前
2020年12月09日

技术饭 ajax跨域:origin has been blocked by CORS policy Response to preflight request doesn't pass access control check

ajax跨域:origin has been blocked by CORS policy Response to preflight request doesn't pass access control check,CORS策略已阻止从原点' http//localhost62797 '访问' http://api.bigcommerce.com/stores/4jwabif3gj/v2/orders.json '处的XMLHttpRequest :对预检请求的响应未收到通过访问控制检查:飞行前请求不允许重定向。

阅读全文 » 1282天前
2020年11月14日

技术饭 wnmp3.1.0安装之后数据库连接报错:port: 3306 source distribution,访问localhost、127.0.0.1报错:10060: A connection attempt failed because...

wnmp3.1.0安装之后数据库连接报错:port: 3306 source distribution,访问localhost、127.0.0.1报错:10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

阅读全文 » 1980天前
2018年12月17日

技术饭 MySQL8.0修改用户密码语句

MySQL8.0修改用户密码语句,mysql8 与以前版本还是有点区别的,首先登陆mysql,mysql -u root -p '密码',use mysql,ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的新密码'

阅读全文 » 2055天前
2018年10月03日

技术饭 navicat for mysql:1130 host is not allowed to connect to

navicat for mysql:1130 host is not allowed to connect to,可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"

阅读全文 » 2657天前
2017年02月08日