Hi there!
I want to connect to a MySQL sever with a perl script using named-pipes instead if TCP/IP.
I'm running on windows xp with activeState Perl, using DBD::mysql to make the connection.
I configured the server to enable named-pipes like this on my.ini
socket = C:/temp/mysql.sock
enable-named-pipe
skip-networking
and this is what my script looks like:
my $dsn = 'DBI:mysql:mydb;mysql_socket=/temp/mysql.sock';
my $db_user_name = 'user';
my $db_password = 'password';
my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
Note: I didn't include the C: in the string because it thinks what comes after the ":" is the host name.
when I run the script I get this:
DBI connect('mydbmysql_socket=/temp/mysql.sock','user',...) failed:
Can't connect to MySQL server on 'localhost' (10061) at myscript.pl l
+ine 60
Does DBD::mysql support named pipes? Do you know if it understands that "/" is actually "C:\"? If not, how do I tell it to look in C:?
Thanks!
David
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.