perl script and mysql

Problems with the Linux version of XAMPP, questions, comments, and anything related.

perl script and mysql

Postby apostolos1975 » 01. October 2007 14:02

Hi all,

I have the following problem:

I can see through phpmyadmin the databases in mysql. The command line also works (mysql -u root ................. etc) but a simple perl script that I try to execute gives me the following error:

DBI connect('database=ir;host=localhost','root',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) at test.pl line 14

I know it has to do with some configuration of the mysql.sock or mysqld.sock but the posts in the forums where not clear on how to solve this.

Any help?

Thanks in advance

Apostolos
apostolos1975
 
Posts: 4
Joined: 27. February 2007 13:29

Re: perl script and mysql

Postby apostolos1975 » 01. October 2007 14:05

I forgot to mention that in the /var/run/mysqld I have created two symbolic links to:

/opt/lampp/var/mysql/mysqld.sock
/opt/lampp/var/mysql/mysql.sock

(dont ask why, I found some suggestions in here and tried them but didnt work)
apostolos1975
 
Posts: 4
Joined: 27. February 2007 13:29

Answer to my problem

Postby apostolos1975 » 02. October 2007 06:53

To anyone with a similar problem the answer was found in the german section of the forum (tough cause I cant speak german). I had to:

DBI->connect("DBI:mysql:$dbname;mysql_socket=/opt/lampp/var/mysql/mysql.sock:$dbhost","$dbuser","$dbpass") || die "Database connection not made: $DBI::errstr";
apostolos1975
 
Posts: 4
Joined: 27. February 2007 13:29


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 4 guests