in reply to NET:MySQL database connection error -- (Using password: NO) at MySQL_queryDB.pl

Which version of MySQL are you running? The last release of Net::MySQL was over three years ago, I've never used it (though I've used DBD::MySQL). Try adding debugging in your constructor:

my $mysql = Net::MySQL->new( hostname => 'testscript', database => 'test', user => 'tester', password => 'tester', debug => 1 );

Super search shows that people are having problem with this module, looking at some of those issues may be worth while.

Update: Also look to see if any of the reported bugs for Net::MySQL are relevant.

Martin

  • Comment on Re: NET:MySQL database connection error -- (Using password: NO) at MySQL_queryDB.pl
  • Download Code

Replies are listed 'Best First'.
Re^2: NET:MySQL database connection error -- (Using password: NO) at MySQL_queryDB.pl
by sqspat (Acolyte) on Sep 24, 2009 at 12:09 UTC
    I am using version Net-MySQL-0.09 see response when I turned debug on;
    pohara@pohara-desktop:~/automation$ perl MySQL_queryDB.pl Use INET Socket: testscript 3306/tcp Net::MySQL::_get_server_information(): 30 00 00 00 0A 34 2E 30 2E 32 36 2D 73 74 61 6E 0....4.0.26-stan 64 61 72 64 00 83 20 00 00 57 39 58 2D 75 2A 6B dard.....W9X-u*k 60 00 2C 20 08 02 00 00 00 00 00 00 00 00 00 00 ..,............. 00 00 00 00 .... Protocol Version: 10 Server Version: 4.0.26-standard Salt: W9X-u*k` Net::MySQL::_send_login_message(): 41 00 00 01 0D A6 03 00 00 00 00 01 21 00 00 00 A............... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 74 65 73 74 65 72 00 14 93 96 51 55 ....tester....QU 6C AC FB C7 30 FC 89 04 3B A8 77 74 60 17 A3 4F l...0...;.wt...O 74 65 73 74 00 test. Net::MySQL::_request_authentication(): 4E 00 00 02 FF 15 04 41 63 63 65 73 73 20 64 65 N......Access.de 6E 69 65 64 20 66 6F 72 20 75 73 65 72 3A 20 27 nied.for.user..' 40 73 62 2D 64 65 73 6B 74 6F 70 2E 6C 6F 63 61 .sb-desktop.loca 6C 2E 63 6F 72 76 69 6C 2E 63 6F 6D 27 20 28 55 l.corvil.com'.(U 73 69 6E 67 20 70 61 73 73 77 6F 72 64 3A 20 4E sing.password..N 4F 29 O) Access denied for user: '@sb-desktop.local.server.com' (Using password +: NO) at MySQL_queryDB.pl line 5 pohara@pohara-desktop:~/automation$

      Hmm, I don't have time to look any further at Net::MySQL at the momemnt, have you considered using DBD::MySQL as mentioned in the MySQL documentation?

      Martin

        got it working with DBI.... the only thing is if I want to pull back a table from the Database ... it is returned in the form of DBI::st=HASH(0xa0dc0c0) ... Is there anyway of pulling back the Table contents in a more readable format??