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!