Sandi Budic Sandi Budic - 1 year ago 452
MySQL Question

Server: Localhost via UNIX socket how to connect?

Can someone help with connecting to my web server?

In phpMyAdmin database is

Server: localhost:3306
when click on it I get:

Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.5.52-cll - MySQL Community Server (GPL)

So how I can connect on it without address or ip?

It is not local it is remote server.

Answer Source

Probably You wanted this:

$socket = '/var/run/mysqld.sock'; // or: /tmp/mysqld.sock
$db = new mysqli('localhost', 'username', 'password', "database", 3306, $socket);
// $db = mysql_connect('localhost:'.$socket, 'username', 'password');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download