SuperNova
SuperNova

Reputation: 3022

Connect PHP/phpMyAdmin to MySQL/MariaDB via named-pipe when skip-networking is enabled on Windows

Apache 2.4, PHP and MySQL or MariaDB Server are all running under Windows 10. phpMyAdmin is used in this environment.

my.ini has the configuration options skip-networking and enable-named-pipe set. So there is no way to connect via network.

HeidiSQL is connecting well using this configuration using . as hostname.

What options may be used for phpMyAdmin, to make him connect? I tried '.', 'localhost', '' and null. I also tried the options of my related posts.

How is this done using mysql::real_connect in PHP itself (which phpMyAdmin uses)? I think the docu is unclear for the socket parameter.

Related on stackoverflow:

My configuration (edit):

enter image description here

Upvotes: 3

Views: 1051

Answers (1)

nbk
nbk

Reputation: 49385

For mysql 80 you need to enter following named pipe for windows

$cfg['Servers'][$i]['socket'] = '\\.\pipe\MySQL80'

you should also check the phpmyadmn manual for connection and the mysql manual for more information on named pipes

To extent the answer:

The MySQL driver will always try to use sockets(linux) or named pipes(windows), when you add localhost as host, only when it can't use Sockets/named pipes, it will try to connect via TCP/IP, so under normal circumstances you don't need the line i wrote, only if you have a different name for the socket/named pipe you need to enter the socket/named pipe at that place.

so if you don't allow TCP/IP communnications for MySQL and the named pipe can't be established the connection would fail.

Upvotes: 1

Related Questions