How to connect via named pipes or shared memory?
Posted: 18.10.2011, 16:16
I am trying to connect to my local Windows MYSQL DB via named pipes or shared memory, but I am getting a connection error.
SQL Error: Can't connect to MySQL server on 'localhost' (10061)
This is the relevant code:
And for named pipes I tried:
And
The my.ini file looks like this:
[mysqld]
#log-error = "C:\errors.txt"
#port = 3306
skip-networking
enable-named-pipe
socket=mysql
shared_memory = ON
shared-memory-base-name=MYSQL
#general-log
I can connect via Navicat to the DB through named pipes just fine.
Please help!
SQL Error: Can't connect to MySQL server on 'localhost' (10061)
This is the relevant code:
Code: Select all
conn := TZConnection.Create(nil);
conn.Protocol := 'mysql-5';
conn.HostName := 'localhost';
conn.Port := -1;
conn.Database := 'data';
conn.User := 'root';
conn.Password := 'xxxx';
conn.Properties.Add('protocol=memory');
conn.Properties.Add('shared-memory-base-name=MYSQL');
conn.Connect;
And for named pipes I tried:
Code: Select all
conn.Properties.Add('protocol=pipes');
Code: Select all
conn.Properties.Add('MYSQL_OPT_NAMED_PIPE');
[mysqld]
#log-error = "C:\errors.txt"
#port = 3306
skip-networking
enable-named-pipe
socket=mysql
shared_memory = ON
shared-memory-base-name=MYSQL
#general-log
I can connect via Navicat to the DB through named pipes just fine.
Please help!