简体   繁体   English

无法通过套接字'/tmp/mysql.sock'(2)错误连接到本地MySQL服务器

[英]Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error

My form is consistently getting an error when I try to submit. 我尝试提交时,我的表单一直出错。

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). 无法通过套接字'/tmp/mysql.sock'(2)连接到本地MySQL服务器。

I'm on windows by the way. 顺便说一句,我在窗户上。 https://web.njit.edu/~jsd42/form/form1.php https://web.njit.edu/~jsd42/form/form1.php

You need to configure your MySQL user and your php mysqli_connect() to both use "localhost" as the connecting host. 您需要配置MySQL用户和php mysqli_connect()以使用“localhost”作为连接主机。

Edit: If it is a remote server instead of "localhost" you will need to use the IP of the mysql server and ensure that the user you are logging in as has permission to connect externally. 编辑:如果它是远程服务器而不是“localhost”,您将需要使用mysql服务器的IP并确保您登录的用户具有外部连接权限。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 警告:mysql_connect():无法通过套接字“ /tmp/mysql.sock”连接到本地MySQL服务器(2) - Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Mac 上的 Django + XAMPP(2002,“无法通过套接字'/tmp/mysql.sock'(2)连接到本地 MySQL 服务器”) - Django + XAMPP on Mac (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") MySQL服务器崩溃且无法启动-无法通过套接字'/tmp/mysql.sock连接到本地MySQL服务器 - MySQL Server crashes and fails to start - Can't connect to local MySQL server through socket '/tmp/mysql.sock Mac Terminal / MySQL配置问题| 错误2002(HY000):无法通过套接字'/tmp/mysql.sock'连接到本地MySQL服务器(2) - Mac Terminal/ MySQL configuration issues | ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 无法连接:无法通过套接字“ /var/lib/mysql/mysql.sock”连接到本地MySQL服务器(2) - Could not connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 尝试了所有事情仍然得到 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in mac - Tried every thing still getting ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in mac mysql连接错误:无法通过套接字'/var/lib/mysql/mysql.sock'连接到本地MySQL服务器(2)Godaddy Cpanel - mysql connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Godaddy Cpanel MAMP “Apache 无法启动,因为端口正在使用中。” 和“无法通过 /tmp/mysql.sock 连接到本地 MySQL 服务器 - MAMP “Apache couldn't be started because port is in use.” AND "Can’t connect to local MySQL server through /tmp/mysql.sock Wordpress中的MYSQL连接问题-无法通过套接字'/var/lib/mysql/mysql.sock'连接到本地MySQL服务器(2) - Issue with MYSQL connection in Wordpress - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Magento错误:SQLSTATE [HY000] [2002]无法通过套接字'/var/lib/mysql/mysql.sock'连接到本地MySQL服务器 - Magento Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM