Forum archive 2000-2006

Robin Cruz - RHE4 Installation Problem: DBI connection failure

Robin Cruz - RHE4 Installation Problem: DBI connection failure

by Arnold Pizer -
Number of replies: 0
inactiveTopicRHE4 Installation Problem: DBI connection failure topic started 7/20/2006; 2:38:02 PM
last post 7/24/2006; 10:57:30 PM
userRobin Cruz - RHE4 Installation Problem: DBI connection failure  blueArrow
7/20/2006; 2:38:02 PM (reads: 401, responses: 7)
I'm installing WeBWork2 on a Red Hat Enterprise 4 machine. (Last summer I did this on a Mandrake machine, ugh, but it died this spring.) My dept had already bought the machine before Mark Hamrick's note (7/20/2006) recommending against RHE4. Mark's note was very helpful. Note: I had to add USE_DSO=1 to make mod_perl load modules in the httpd.conf file. It does not load mod_info so "server-info" does not work, as mentioned in the Installation Manual V2.2. It is loading mod_perl, so I've been assuming mod_perl is working.

I have worked my way through to where the webwork courses page can be brought up in a browser (http://docralph.albertson.edu/webwork2), but when I click on the modelCourse link I get the following error:

Error messages
error instantiating DB driver WeBWorK::DB::Driver::SQL for table problem_user: DBI connect('webwork','webworkRead',...) failed: Access denied for user 'webworkRead'@'localhost' (using password: YES) at /opt/webwork2/lib/WeBWorK/DB/Driver/SQL.pm line 62
at /opt/webwork2/lib/WeBWorK.pm line 212

About the only thing I have not replaced on my machine is the mysql server which is version 4.1.20 (replaced Perl, mod_perl, Apache). I used CPAN to get all the Perl modules listed in the Installation Manual. I have checked to make sure the passwords on the mysql WeBWorK table and the ones I typed into the database.conf file match.

Any suggestions? --rac

<| Post or View Comments |>


userMichael Gage - Re: RHE4 Installation Problem: DBI connection failure  blueArrow
7/20/2006; 3:32:22 PM (reads: 429, responses: 0)
Robin,

I can tell you what is wrong, although not for sure how to fix it. The communication between webwork and your mysql database is still not yet correctly set up. Instructions for setting permissions are at:

http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/InstallationManualV2pt2#Database_configuration

specifically:

 

$ mysql -u root -p mysql
Password: **
################## CREATE DATABASE webwork;
> GRANT SELECT ON webwork.* TO webworkRead@localhost IDENTIFIED BY 'passwordRO';
> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'passwordRW';
> exit
Bye
$

You might try doing this again (Don't create the database again -- just reissue the GRANT commands. ). The passwordRO should be the same as the one in database.conf and the same for passwordRW. I believe what you can read in the mysql webwork table will only be the encoded version of these passwords, so that might be the problem.

Also check to make sure that the admin course tables have been created in the database webwork: e.g. webwork.admin_user webwork.admin_set webwork.admin_key and similar tables should exist.

One other trick you can try is to issue the GRANT command above omitting the entire IDENTIFIED by clause at the end. Then set your passwords in database.conf to be empty strings "". That might get you connected so that you can check that everything else is ok.

I can tell that you are using a slightly older version of webwork2 since now we only need to set the password once in global.conf instead of database.conf. however I don't think that makes a difference:

cvs update -r rel-2-2-1 -d gets the latest stable release if you are hooked up to the cvs.

Take care,

Mike

<| Post or View Comments |>


userMichael Gage - Re: RHE4 Installation Problem: DBI connection failure  blueArrow
7/20/2006; 7:32:35 PM (reads: 430, responses: 0)
One other idea. mysql keeps an error log somewhere perhaps /var/db or /var/db/mysql ? You may have actually specified the location while configuring mysql. In any case look in that error log and see if the messages give additional insight as to why the connection is not being made.

<| Post or View Comments |>


userRobin Cruz - Re: RHE4 Installation Problem: DBI connection failure  blueArrow
7/24/2006; 10:33:54 AM (reads: 419, responses: 0)
OK, I redid the GRANT command and checked that the tables were indeed being created in mysql -- which wasn't happening before. I created the admin course via command line and changed the permissions on the folders so that Apache had write/read access, but now, when I try to log into the admin course, I get a message that the user ID or password are incorrect. (I'm not getting any other kind of error message.) I checked the password table in mysql and I am using the correct ID and password stored there.
I have not found the mysql error log file yet which might help. I might try upgrading WeBWorK too, but I'm reluctant to introduce more unknowns until I get this part working. On the other hand, do you think upgrading could fix the problem?

Thanks for your help -- rac

<| Post or View Comments |>


userMichael Gage - Re: RHE4 Installation Problem: DBI connection failure  blueArrow
7/24/2006; 11:04:22 AM (reads: 413, responses: 0)
Sounds like progress. I also wouldn't update webwork just yet. It seems to me that you are almost there. I'm still pretty sure that the password you see in mysql is NOT the one you have to enter, but an encoded version. It's safer to reset the password to something you know for sure is correct. The newpassword.pl script in webwork2/bin will do this for you.

<| Post or View Comments |>


userMark Hamrick - Re: RHE4 Installation Problem: DBI connection failure  blueArrow
7/24/2006; 4:47:17 PM (reads: 465, responses: 0)
Another suggestion is to install PHPMyAdmin and check out the database using it. I have found configuration problems with MySQL serveral times using PHPMyAdmin.

<| Post or View Comments |>


userMichael Gage - Re: RHE4 Installation Problem: DBI connection failure  blueArrow
7/24/2006; 6:24:59 PM (reads: 410, responses: 0)
another way to check connections. From the command line:

 

> mysql  -u webworkWrite -p
>Password: webworkWritePassword
hopefully this connects you.

Then

 

>>show databases;
>>use webwork;
>>show tables;
>>quit;

should give you some idea of what is in the webwork.* database.

Hope this helps.

Take care,

Mike

<| Post or View Comments |>


userRobin Cruz - Re: RHE4 Installation Problem: DBI connection failure  blueArrow
7/24/2006; 10:57:30 PM (reads: 410, responses: 0)
Good news, I changed the password as you suggested and I'm in.

Thanks, so much, for your help -- rac

<| Post or View Comments |>