I am using Perl DBI to interface with MySQL and when i execute the
following statement:
$dbh = DBI->connect('DBI:mysql:database=dbmysql2', undef, undef,
{PrintError =>0}) || die $ DBI::errstr;
it causes the error:
[Fri Aug 17 09:59:50 2001] productioncontent14.pl: Access denied for user:
'@localhost'
to database 'dbmysql2' at productioncontent14.pl line 29, <STDIN> line 1

the dbi connect is being invoked by a perl program which is run from the
command line.

when i execute the above DBI->connect statement with my MySQL userid and
password it works fine.
i have MySQL (not unix) root level privileges. for performance and
security reasons i prefer to execute the version of the connect which is
failing.

i am running MySQL as described below:
Server version 3.23.36
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock

i am running Perl 5.6 and Red Hat 7.1 Linux 2.4.3-12 
i checked that i have access to mysql.sock

in addition to a my local host with my user name which is fully
privileged, i currently show local host with no user name and no password
in the mysql user table and with no privileges. i tried, as mysql root, to
grant all privileges to localhost, which has no user name, via the sql command:
grant all privileges on *  to "%@localhost";
this resulted in a user table entry of no host name, a user name of
"%@localhost" and no privileges. this didn't seem useful so i deleted the
new user name, "%localhost" from all of the mysql security tables.

thankyou
steve

Reply via email to