I'm looking for a better way to fix my problem.
I'm using Perl, DBI, DBD::mysql,
I was getting this error...
"Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)"
the default setting for looking for mysql.sock in either DBI or DBD is
/var/lib/mysql/mysql.sock
(at least on my install), yet the real location is /tmp/mysql.sock
I never had a problem until I tried a simple CGI program.
This fixed the problem by adding the mysql_socket attribute to my
connection...
$dbh =
DBI->connect("DBI:m ysql:host=local host:mysql_sock et=/tmp/mysql.sock;data base=business". ..
Do you know of a way to avoid adding this attribute to my connection string?
Thanks,
Don
I'm using Perl, DBI, DBD::mysql,
I was getting this error...
"Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)"
the default setting for looking for mysql.sock in either DBI or DBD is
/var/lib/mysql/mysql.sock
(at least on my install), yet the real location is /tmp/mysql.sock
I never had a problem until I tried a simple CGI program.
This fixed the problem by adding the mysql_socket attribute to my
connection...
$dbh =
DBI->connect("DBI:m ysql:host=local host:mysql_sock et=/tmp/mysql.sock;data base=business". ..
Do you know of a way to avoid adding this attribute to my connection string?
Thanks,
Don
Comment