Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: DBI with 2nd mysql server, nonstandard port

by dbwiz (Curate)
on Feb 26, 2005 at 22:17 UTC ( #434827=note: print w/ replies, xml ) Need Help??


in reply to DBI with 2nd mysql server, nonstandard port

There are two issues here:

  • For MySQL, connecting to "localhost" means using a Unix socket (or a named pipe in Windows). That's why you needed to set $ENV{'MYSQL_UNIX_PORT'}. Instead of doing that, you could have used either of these statements:
    • my $dbh=DBI->connect('dbi:mysql:dbname' . ';host=127.0.0.1' . ';port=3310', 'user', 'password');
    • my $dbh=DBI->connect('dbi:mysql:dbname' . ';host=localhost' . ';mysql_socket=/var/mysql4.1.9/mysql.sock', 'user', 'password');
  • As for the client issue, with MySQL 4.1 there is a new communication protocol to identify clients to the server. Also here, you have two choices:
    • Reinstall DBD::mysql, using the new client libraries from the newly installed 4.1.9 package.
    • Ask the administrator to change your password using the OLD_PASSWORD function, or do it yourself: just connect to the server using the command line client, and issue this command:
      SET PASSWORD=OLD_PASSWORD('yoursecretpassword');

HTH


Comment on Re: DBI with 2nd mysql server, nonstandard port
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://434827]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2014-10-22 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls