SQLSTATE[HY000] [2002] 错误

使用tp框架 3.2.3 ,在windows上跑的时候没有任何问题,但是部署到linux系统和是哪个,就会报这个错
,将localhost改为127.0.0.1即可

:(
SQLSTATE[HY000] [2002] No such file or directory
错误位置

FILE: /phpstudy/www/mmm/ThinkPHP/Library/Think/Db/Driver.class.php  LINE: 109
TRACE

#0 /phpstudy/www/mmm/ThinkPHP/Library/Think/Db/Driver.class.php(109): E('SQLSTATE[HY000]...')
#1 /phpstudy/www/mmm/ThinkPHP/Library/Think/Db/Driver.class.php(1075): Think\Db\Driver->connect()
#2 /phpstudy/www/mmm/ThinkPHP/Library/Think/Db/Driver/Mysql.class.php(47): Think\Db\Driver->initConnect(true)
#3 /phpstudy/www/mmm/ThinkPHP/Library/Think/Model.class.php(138): Think\Db\Driver\Mysql->getFields('inkks_xin')
#4 /phpstudy/www/mmm/ThinkPHP/Library/Think/Model.class.php(126): Think\Model->flush()
#5 /phpstudy/www/mmm/ThinkPHP/Library/Think/Model.class.php(1458): Think\Model->_checkTableInfo()
#6 /phpstudy/www/mmm/ThinkPHP/Library/Think/Model.class.php(101): Think\Model->db(0, '', true)
#7 /phpstudy/www/mmm/ThinkPHP/Common/functions.php(621): Think\Model->__construct('xin', '', '')
#8 /phpstudy/www/mmm/appx/Home/Controller/IndexController.class.php(9): M('xin')
#9 [internal function]: Home\Controller\IndexController->index()
#10 /phpstudy/www/mmm/ThinkPHP/Library/Think/App.class.php(173): ReflectionMethod->invoke(object(Home\Controller\IndexController))
#11 /phpstudy/www/mmm/ThinkPHP/Library/Think/App.class.php(110): Think\App::invokeAction(object(Home\Controller\IndexController), 'index')
#12 /phpstudy/www/mmm/ThinkPHP/Library/Think/App.class.php(204): Think\App::exec()
#13 /phpstudy/www/mmm/ThinkPHP/Library/Think/Think.class.php(120): Think\App::run()
#14 /phpstudy/www/mmm/ThinkPHP/ThinkPHP.php(97): Think\Think::start()
#15 /phpstudy/www/mmm/index.php(7): require('/phpstudy/www/m...')
#16 {main}

 

转载于:https://my.oschina.net/u/145255/blog/1816164

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值