[Dxspider-support] DBI interface error

Dirk Koopman djk at tobit.co.uk
Thu Mar 24 23:20:11 GMT 2022


Try changing the $dsn strings to be the same (i.e. lose the ':3306').

On 24/03/2022 23:04, IZ5FSA via Dxspider-support wrote:
> Hi OMs,
>
> I have this error on access to MariaDB.
>
>> DBI connect('dxcluster:localhost:3306','sysop',...) failed: Access 
>> denied for user 'sysop'@'localhost' (using password: YES )  at 
>> /spider/perl/DXSql.pm line 63.
> In  /spider/local-new/DXVars.pm I have:
>
>> # the SQL database DBI dsn
>> #$dsn = "dbi:SQLite:dbname=$root/data/dxspider.db";
>> #$dbuser = "";
>> #$dbpass = "";
>>
>> # the SQL database DBI dsn
>> $dsn = "dbi:mysql:dxcluster:localhost:3306";
>> $dbuser = "sysop";
>> $dbpass = "MyPassword";
> In MariaDB the user "sysop" have grant full access to the dxcluster 
> database.
>
>
> If I use this script, access is fine...
>
>> #!/usr/bin/perl
>>
>> use DBI;
>>
>> $source = "DBI:mysql:dxcluster:localhost";
>> $username = "sysop";
>> $password = "MyPassword";
>>
>> $dbc = DBI->connect($source, $username, $password)
>> or die "Unable to connect to mysql: $DBI::errstr\n";
>>
>> $sql = $dbc->prepare("SELECT count(*) FROM spot_backup");
>>
>> $out = $sql->execute()
>> or die "Unable to execute sql: $sql->errstr";
>>
>> while (($id, $name) = $sql->fetchrow_array())
>> {
>>  print "Id: $id Name: $name\n";
>> }
> ...and obviously it return
>
>> Id: 0 Name:
> because table is empty.
>
> I cannot find any documentation of this DBI feature in docs.
>
> Where is the trick? In the MariaDB parameters? Anyone have tryed this 
> kind of error?
>
> best 73 de Leo IZ5FSA
>
>
>
>
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at tobit.co.uk
> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support




More information about the Dxspider-support mailing list