[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: TCPQuota. possible bug?



On 15 Aug 2001 21:06:26 +0100, Nick Avenell wrote:
> On Wed, 15 Aug 2001 19:00:08 +0200, in linux.debian.user you wrote:
> 
> >On 15 Aug 2001 14:03:11 +0100, Nick Avenell wrote:
> >> On Wed, 15 Aug 2001 06:50:04 +0200, in linux.debian.user you wrote:
> >> 
> >> >On 14 Aug 2001 22:58:09 +0100, Nick Avenell wrote:
> >> >> I tried to install TCPQuota on my woody box (sacrifice) tonight, and
> >> >> couldn't. This is what happened:
> >> *snip*
> >> >> sacrifice:~# tcpquotad
> >> >> sacrifice:~# DBI->connect(tcpquota:localhost:3306) failed: Access
> >> >> denied for user: 'root@localhost' (Using password: NO) at
> >> >> /usr/sbin/tcpquotad line 376
> >> >It appears that the script is not giving the correct option/password to
> >> >mysql because the log says Using password:  NO.  What does line 376 look
> >> >like?
> >> >--mike
> >> 
> >> ---------fragment of /usr/sbin/tcpquotad --------------
> *desnip*
> >>     $dbh = DBI->connect("dbi:$cf{'ENGINE'}:tcpquota:$cf{'SERVER'}");
> >> 
> >> -------------------end fragment------------------------
> >> 
> >> (Last line is 376)
> >
> >Looks like its inheriting definitions from the cf file.  What do ENGINE
> >and SERVER get defined as at the top of this file or in the config file
> >for the system. 
> ---------fragment of /etc/tcpquota/tcpquota.cf --------------
> #
> # Database interface.
> # Where is the databases running, and at what
> # port? (<address>:<port>). Do NOT forget the
> # port number.
> SERVER=localhost:3306
> 
> # Which database engine should we use?
> ENGINE=mysql
> -------------------------------------------------------------

Is there a PASSWORD definition (don't show me it on the mailing list
though if it is)?

It looks to me like you need to add one more argument to the
$dbh = DBI->connect("dbi:$cf{'ENGINE'}:tcpquota:$cf{'SERVER'}");
line.  I browsed around the perl cpan documentation to find this bit o'
info:

 my $dbh = DBI->connect('DBI:Oracle:payroll', 'username', 'password')
                or die "Couldn't connect to database: " . DBI->errstr;


This leads me to beleive that you need to add a comma and then your
username and password for mysql.  Ie:

$dbh = DBI->connect("dbi:$cf{'ENGINE'}:tcpquota:$cf{'SERVER'}", 'root',
'yourpassword');

should go into your script.  I don't know why it isn't in there to begin
with.  Maybe this will work?

--mike



Reply to: