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

Re: MySQL vs user www-data



Christian Hammers wrote:
> > > On Sun, May 07, 2000 at 09:48:00PM -0500, w trillich wrote:
> > 'course, my DBILog routine in apache is still broke, after the
> > reinstall.
> You deinstalled libdbd-mysql-perl, if I remember correctly.

good eye. i probably forgot to include the reinstall in my post.

# dpkg -l libdbd\*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name              Version    Description
+++-=================-==========-=========================================
ii  libdbd-csv-perl   0.1022-1   perl DBD::CSV - DBI driver for CSV files
ii  libdbd-mysql-perl 1.2202-4   mySQL database interface for Perl
ii  libdbd-pg-perl    0.93-2     a PostgreSQL interface for Perl 5
using DBI.


okay. i do have mysql working _via cgi/perlrun_; but the DBILog facility
handler gizmo is still dying. i'm on the scent, tho--

select * from [mysql.]user ; shows that www-data does
have select/insert/update/delete permissions; besides 'user'
only the 'db' table contains records (for the test set, i see).


from httpd.conf (my only apache conf file, these days):
	PerlInitHandler Stonehenge::DBILog

i output debug stuff to a log file:
	[Mon May  8 13:54:22 2000] null: DBI->connect failed: 
	Access denied for user: '@localhost' to database 'will' 
	at /usr/local/lib/site_perl/Stonehenge/DBILog.pm line 87
	DSN=dbi:mysql:will; DB_AUTH=www-data

in Stonehenge/DBILog.pm (line 87, where it panics):
	my $dbh = DBI->connect($DSN, $DB_AUTH, "", { RaiseError => 1 });

note that "user: '@localhost'" doesn't have a username?
is it ignoring $DB_AUTH on the connect for some reason...?

why i tryied my cgi script as www-data it breaks with the same
problem; but the other authorized usernames work fine.

aha. i tried
	% mysql -u www-data
	ERROR 1045: Access denied for user: 'www-data@localhost' (Using
password: YES)
	% mysql -u www-data -p
	Enter password: [empty password]
	Welcome to the MySQL monitor.  Commands end with ; or \g.
	Your MySQL connection id is 255 to server version: 3.22.32-log

	Type 'help' for help.

	mysql> show databases ;
	+-----------+
	| Database  |
	+-----------+
	| mysql     |
	| mysql-new |
	| test      |
	+-----------+
	4 rows in set (0.00 sec)
	
	mysql> \u test
	Database changed
	mysql> \u mysql
	ERROR 1044: Access denied for user: '@localhost' to database 'mysql'
	mysql> Bye
	% mysql
	Welcome to the MySQL monitor.  Commands end with ; or \g.
	Your MySQL connection id is 256 to server version: 3.22.32-log
	
	Type 'help' for help.
	
	mysql> \u mysql
	Database changed
	mysql> select * from user where user='www-data';
[edited for readability]
	Host				%
	User				www-data
	Password			
	Select_priv		Y
	Insert_priv		Y
	Update_priv		Y
	Delete_priv		Y
	Create_priv		n
	Drop_priv			n
	Reload_priv		n
	Shutdown_priv		n
	Process_priv		n
	File_priv			n
	Grant_priv		n
	References_priv	n
	Index_priv		n
	Alter_priv		n
	
	1 row in set (0.00 sec)
	
	mysql> Bye

how do i find the catch? what permission is missing?
(and why does it report 'www-data@localhost' vs '@localhost'?)


--


[plus, in /var/log/apache/errors.log i still get
[Mon May  8 13:58:01 2000] [error] [Mon May  8 13:58:01 2000] null:
Can't locate object method "log" via package "Apache" at
/usr/local/lib/site_perl/Stonehenge/DBILog.pm line 95.

which refers to the perl code
	package Stonehenge::DBILog;
	...
	sub handler { my $r = shift;
	...
	$r->log->error("dbi: $@");	# <== boom
	...
	}
]

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Their is five errers in this sentance.


Reply to: