解决ThinkPHP报错: SQLSTATE[HY000] [2002] No such file or directory

有一个程序是基于ThinkPHP框架写的,直接访问其中的方法是没问题的,但是通过命令行访问就出问题了,提示: SQLSTATE[HY000] [2002] No such file or directory

解决方法就是:在database.php中奖localhost改为127.0.0.1就好了。

上一篇: 阿里云ECS云服务器安装LNMP后开放远程访问mysql权限
下一篇: 解决可道云KodCloud分享链接失效问题

发表评论


数据库出错:

MySQL Query Error
Mysql error description: Duplicate entry '0' for key 'uid'
Mysql error number: 1062
Date: 2024-06-03 @ 06:29
Script: http://blog.is36.com/index.php/fr/category/umjagchiteli-bytovye-atoll-excellence/auxpage_1/category/559/auxpage_2/auxpage_1/product/trehstupenchatyj-filtr-atoll-a-32beiki-32bi-std-/links/page/3/archives/437/links/date/201708/archives/442/wap/page/5/wap/date/201910/archives/467/templates/default/img/?action=show&id=477