Difficulty connecting via named pipe to MariaDB

[expired user #7474]'s profile image [expired user #7474] posted 10 years ago in Creating a connection Permalink
I'm a new user of MariaDB. I've successfully installed MariaDB on my Windows 7 64-bit system and established a new user with all privileges to all databases. I am able to login via the mysql client as well as connect via the MySQL ODBC Connector using a named pipe. So far, no problems. (I've disabled network access, as I have no interest in allowing remote access to my databases at this time.)

However, I'm unable to connect with HeidiSQL. Network type for the connection is "MySQL (named pipe)", socket name is "MySQL" (which works just fine for ODBC Connector), and no matter whether I try to login as root, the user I created, or simply prompt for credentials, the connection fails with an error dialog:

SQL Error (2013) in statement #0: Lost connection to MySQL server at 'waiting for initial communication packet', system error: 0

My "my.ini" file is below. Can someone kindly tell me what I'm doing wrong?



[mysqld]
datadir=C:/Program Files/MariaDB 5.5/data
skip-networking=1
skip-name-resolv=1
enable-named-pipe
socket=MySQL
port=3306
sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
default_storage_engine=innodb
innodb_buffer_pool_size=256M
innodb_log_file_size=50M
character-set-server=utf8

[client]
socket=MySQL
protocol=pipe
ansgar's profile image ansgar posted 10 years ago Permalink
Just got it running using this configuration on a local MySQL 5.5.8 server:

[mysqld]
port		= 3306
socket		= mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K
enable-named-pipe
skip_name_resolve=1
log-error="d:/heidisql/logs/mysql.log"


You are missing an "e" in "skip-name-resolv", and I'm not sure if it must be underlines, as the documentation says so. But anyway that cannot be the problem.

I had problems with the default "socket=/tmp/mysql.sock". I removed the path then, cannot find that file now anyway but it runs fine when I connect through named pipe now. I think you should activate the log-error file, so you can probably see what's wrong on server start.
[expired user #7474]'s profile image [expired user #7474] posted 10 years ago Permalink
Thank you for catching the missing 'e' with "skip_name_resolve". I tried it with both hyphens and underscores, and I found no change in the behaviour or error log output. (In any case, I've commented this line out.)

When (re)starting the server, the last two lines of the error log seemed relevant:

131208  1:12:22 [Note] C:\Program Files\MariaDB 5.5\bin\mysqld.exe: ready for connections.
Version: '5.5.34-MariaDB'  socket: ''  port: 0  mariadb.org binary distribution


If I understand this output correctly, it is saying that I have no socket defined. But if that were so, it seems to me that I shouldn't be able to connect by named pipe using the "mysql" client nor the ODBC Connect interface, and I can with both.

Checking things in "mysql":

MariaDB [test]> STATUS;
--------------
mysql  Ver 15.1 Distrib 5.5.34-MariaDB, for Win64 (x86)
Connection id:          1
Current database:
Current user:           ODBC@localhost
SSL:                    Not in use
Using delimiter:        ;
Server:                 MariaDB
Server version:         5.5.34-MariaDB mariadb.org binary distribution
Protocol version:       10
Connection:             Named pipe: MySQL
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    cp850
Conn.  characterset:    cp850
UNIX socket:            MySQL
Uptime:                 34 sec


I tried changing the socket name a few times, but no change. No problems connecting from either the mysql client or through the ODBC interface, but I'm still unable to connect with HeidiSQL.

I temporarily enabled networking and tried connecting via TCP/IP, and HeidiSQL worked perfectly. So something seems to be up with named pipes, at least on my machine. I'm unsure how to proceed at this stage, or if I'm even polling the correct forum at this point . . .

In any case, I appreciate your very swift reply!
ansgar's profile image ansgar posted 10 years ago Permalink
Using the forum is fine here, as you definitely have a HeidiSQL related question.

I too have this line in mysql.log:
Version: '5.5.8'  socket: ''  port: 3306  MySQL Community Server (GPL)


...with the difference that it works here without a problem.

I'm also unsure, as you have set the same settings.

Probably we have another libmysql.dll issue. Which one are you using? (32/64bit and version - rightclick on that file > properties > details)
[expired user #7474]'s profile image [expired user #7474] posted 10 years ago Permalink
I installed the 64-bit version of MariaDB. Version of libmysql.dll is cited in Properties as being 5.5.34.3976.

Thank you!!

Please login to leave a reply, or register at first.