WeBWorK Main Forum

More problems creating admin course

More problems creating admin course

by Robert Byerly -
Number of replies: 2
Hi all,

I am also having some mysterious troubles adding an admin course to a new WeBWorK installation. My problems seem similar to Brian Camp's issues (see https://webwork.maa.org/moodle/mod/forum/discuss.php?d=5744), but not quite the same.

I'm using Suse 10.2 with Apache 2.2.4 + mod_perl.2.03 compiled from source, and using webwork rel-2-4-dev downloaded via cvs. I've set permissions on directories following the instructions, added a "webworkWrite" user to mysql and set $database_password in global.conf.

My web server is running as "daemon", so when I try creating the admin course using:

sudo -u daemon env WEBWORK_ROOT=/opt/webwork/webwork2 /opt/webwork/webwork2/bin/addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admin

I get

error instantiating DB driver WeBWorK::DB::Driver::SQL for table problem_user: DBI connect('webwork','',...) failed: Access denied for user 'byerly'@'localhost' (using password: NO) at /opt/webwork/webwork2/lib/WeBWorK/DB/Driver/SQL.pm line 65 at /opt/webwork/webwork2/lib/WeBWorK/Utils/CourseManagement.pm line 219


Incidentally, when I just try connecting to the (non-existent) admin course through a web browser, I get the following error message:

error instantiating DB driver WeBWorK::DB::Driver::SQL for table problem_user: DBI connect('webwork','',...) failed: Access denied for user 'daemon'@'localhost' (using password: NO) at /opt/webwork/webwork2/lib/WeBWorK/DB/Driver/SQL.pm line 65 at /opt/webwork/webwork2/lib/WeBWorK.pm line 286

For some reason it seems to be trying to connect as the owner of the process instead of as $database_user (which is set to "webworkWrite").

Any help will be appreciated.

Bob Byerly

In reply to Robert Byerly

Re: More problems creating admin course

by Gavin LaRose -
Hi Bob,

Every time I've seen this error it's because I've had some error in the definition of the webwork $database_user in my conf file. At the risk of telling you something that I'm sure you've tried before, I'd suggest double checking that.

Can you log in to mysql from the command prompt using the webwork $database_user?
prompt$ mysql -u webworkWrite -p webwork

Gavin
In reply to Gavin LaRose

Re: More problems creating admin course

by Robert Byerly -
Thanks Gavin,

Actually it was a different bone-headed error. I had started the install, had to put it on hold for a few months, and then before resuming updated from cvs again. As a result, my database.conf file was from a previous version of WeBWorK, with enough differences from the new version to really mess things up. For some reason I had thought to update global.conf, but didn't even think about database.conf (which I rarely have to touch anyway.)

Seems to be working now.

Bob