简体   繁体   中英

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).

I'm on windows by the way. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM