Php link to MySQL

解决PHP连接MySQL失败问题
本文探讨了在MacOSX环境下使用PHP连接MySQL时遇到“No such file or directory”的错误,并提供了解决方案,包括检查MySQL服务状态及使用“127.0.0.1”替代“localhost”。
  1. how can php get ajax parameter?
  2. Connection failed on Mac OS X: php + MySQL:
    Error message:

    Warning: mysqli::mysqli():(HY000/2002):No such file or directory in /Library/WebServer/Documents/php/getDBInfo.php

    solution:
    first check if MySQL has been started on your device;
    if the above operation does not work, replace “localhost” with “127.0.0.1”

    The reason is that “localhost” is a special name for the mysql driver making it use the unix socket to connect to mysql instead of the a tcp socket.(from http://stackoverflow.com/questions/4219970/warning-mysql-connect-2002-no-such-file-or-directory-trying-to-connect-vi @luismreis answer)

so much for now. Switch to div overlap~Bye~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值