`
wangminshe89
  • 浏览: 665320 次
文章分类
社区版块
存档分类
最新评论

Openbsd 下面 mysql 报错socket '/var/run/mysql/mysql.sock

 
阅读更多

#2002-Can'tconnecttolocalMySQLserverthroughsocket'/var/run/mysql/mysql.sock'(2)


道理很简单,因为你的mysql_connect是一个localhost,而不是你服务器的名字,如
果是localhost, PHP就会用mysql.sock文件,而不用正常的TCP连接。
apache在OpenBSD下都是chroot过了,这一点你可以 ps agx | grep httpd | grep parent 看到,chroot过apache根目录在/var/www,而你的mysql mysql.sock 文件在/var/run/mysql.

有两个解决方案:
1。mysql_connect 不用localhost,而是你的服务器名字www.yourserver.blablabla
2. 在 /etc/rc.conf 里的httpd,加"-u" httpd_flags="-u" 这样apache就不chroot了,不过我不喜欢这个方案,不安全。。。

man chroot , man rc.conf

分享到:
评论

相关推荐

    在线自动升级openssh9.0p1的shell脚本,亲测可用!

    openssh_download="https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/$openssh_version.tar.gz" # Function :openssh-9.0p1 update # # Platform :Centos7.X # # Version :2.0 # # Date :2022-05-01 #

    cgofuse:适用于Go的跨平台FUSE库-可在Windows,macOS,Linux,FreeBSD,NetBSD,OpenBSD上运行

    Go的跨平台FUSE库 Cgofuse是Go的跨平台FUSE库。 它在多个平台上受支持,并且可以移植到具有FUSE实现的任何平台上。 根据平台的不同,它具有和 (“ nocgo”)变体。...> go install -v ./fuse ./examples/mem

    centos7 ssh一键自动化升级脚本

    4、使用root权限执行脚本(./update_openssh.sh)就可以一键完成升级,如果缺少依赖包会有相应的提示(依赖gcc、pam-devel、zlib、zlib-devel、perl,perl版本要求5.8.8以上) 5、如果以后版本有升级,只需要从下面...

    No.Starch.Absolute.OpenBSD.2nd.Edition.Apr.2013

    It won't say, `Please step away from the keyboard before I hurt you.' Not threatening you passes for user-friendly in OpenBSD." In both cases his jokes are funny because they come loaded with more ...

    升级OpenSSL和OpenSSH至8.2

    4、使用root权限执行脚本(./update_openssh.sh)就可以一键完成升级,如果缺少依赖包会有相应的提示(依赖gcc、pam-devel、zlib、zlib-devel、perl,perl版本要求5.8.8以上); 5、如果以后版本有升级,只需要从...

    LINUX gd-2.0.35.tar.gz

    1. Type './configure' 2. Type 'make install' Generic configuration instructions are in the file INSTALL. The following 3rd-party libraries will be used by gd if found by configure. While gd will ...

    OpenBSD+Nginx+MySQL+PHP环境搭建手册[第二版][汇编].pdf

    OpenBSD+Nginx+MySQL+PHP环境搭建手册[第二版][汇编].pdf

    socket——Richard Stevens' sock program RPM 64位版

    It was likewise indicating signs of bitrot, so I dusted it off and updated it to build on at least Linux, FreeBSD, OpenBSD, and MacOS, and made it available for download here. I'm more than happy ...

    socket——Richard Stevens' sock program RPM 32位版

    It was likewise indicating signs of bitrot, so I dusted it off and updated it to build on at least Linux, FreeBSD, OpenBSD, and MacOS, and made it available for download here. I'm more than happy ...

    yacdn.org:另一个CDN

    此回购和服务不再维护。 yacdn.org 另一个CDN。 CDN 如何使用 默认情况下,文件将在缓存中保留24小时。 ... 是否需要比24小时更频繁地刷新对象? 您可以手动设置maxAge : ...通过使用代理端点,还可以用作有效的代理/ ...

    Absolute.OpenBSD.UNIX.For.The.Practical.Paranoid.eBook-LiB.7z

    Absolute OpenBSD—UNIX for the Practical Paranoid Chapter 0 - Introduction Chapter 1 - Additional Help Chapter 2 - Installation Preparations Chapter 3 - Dedicated Installation Chapter 4 - ...

    openssh8.4p1-update-el7.tar.gz

    文件解压后参看说明文件,如续openssh出新版本后,请到https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/下载最新版本,然后替换升级包里的openssh-8.4p1.tar.gz即可. 注备:升级到openssh8.X后,xshell5的就...

    console.rpki-client.org:生成rpki控制台网站的脚本

    RPKI控制台RPKI控制台的... 简单的方法: cvs -d anoncvs@anoncvs.ca.openbsd.org:/cvs checkout -P src/regress/usr.sbin/rpki-client艰辛的道路: cd /usr/srcftp https://cdn.openbsd.org/pub/OpenBSD/6.8/src.tar

    openssh8.4p1-update-el6.tar.gz

    文件解压后参看说明文件,如续openssh出新版本后,请到https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/下载最新版本,然后替换升级包里的openssh-8.4p1.tar.gz即可. 注备:升级到openssh8.X后,xshell5的就...

    mysql5.5.28.zip

    多平台支持,包括Solaris,SunOS,BSDI,SGI IRIX,AIX,DEC UNIX,Linux,FreeBSD,SCO OpenServer,NetBSD,OpenBSD,HPUX,Win9x and NT;多样的数据类型,包括有/无符号1,2,3,4,8字节integers,FLOAT,...

    openssh-8.2p1.tar.gz

    可根据需要进行下载升级下载地址:http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/

    openbsd.sort.rar_openbsd

    openBSD UNIX sort命令实现完整源代码

    超级启动盘制作方法

    声明:该启动盘支持安装windows,ubuntu,openbsd,freebsd。 经过本人的无数次小白实验,终于成功的制作了一个超级启动盘,所以跟大家分享一下。对于各种系统的狂热好奇,我可以说是费尽了心思去研究如何安装它们,...

    MYSQL 5.7.12.zip

    MySQL (数据库服务器)是一款小型关联式数据库管理系统,MySQL (数据库服务器)的执行性能非常高,运行速度非常快,并非常容易使用,是一个非常捧的数据库。MySQL (数据库服务器)在世界上是最流行的数据库语言。...

Global site tag (gtag.js) - Google Analytics