Hello below is my Nodejs code is working fine into my local computer.
var client = mysql.createClient({
user: '(your user here)',
password: '(your password here)',
host: '127.0.0.1',
port: '3306',
_socket: '/var/run/mysqld/mysqld.sock',
});
but how can i write the path of "_socket" when i connect with another server. my database located into another lan server and my server ip is 192.168.12.166. how can connect mysql into this server.
Thanks
Remove the (undocumented?)
_socket
option and change thehost
value:However, this assumes that the MySQL database on 192.168.12.166 is configured to accept TCP connections (see the answer to this question on how to do that).