## WeBWorK Main Forum

### error message

by Justin Heckman -
Number of replies: 3
I set up a server working great using dhcp, but when I set it up for a static IP I started getting the following error. This error occurs when I click on any installed class to login in. Intead of navigating to the login page I get this error.

### Error messages

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

### Call stack

The information below can help locate the source of the problem.

• in Carp::croak called at line 262 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
• in WeBWorK::DB::init_table called at line 254 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
• in WeBWorK::DB::init_table called at line 223 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
• in WeBWorK::DB::new called at line 286 of /opt/webwork/webwork2/lib/WeBWorK.pm
Any help on solving this problem would be greatly appreciated.

### Re: error message

by Gavin LaRose -
Hi Justin,

The message stays that WeBWorK isn't able to talk to the mysql daemon, so my guess would be that one of the following is true:
- mysql isn't running,
- it's running, but not on the host that the WeBWorK apache server is running on,
- it's running on localhost, but something with the name resolution is causing WeBWorK to fail to find it, or
- it's runnong on localhost, and there's some password error.

I'm guessing the first isn't a problem, because the access denied error looks like an error from mysql. I'll assume that the mysql daemon that WeBWorK is looking for is on the same host as the WeBWorK/apache install as well.

If you run
$nslookup localhost do you get back an expected answer? For example, I get Server: 141.211.xxx.xxx Address: 141.211.xxx.xxx#53 Non-authoritative answer: Name: localhost.math.lsa.umich.edu Address: 127.0.0.1 If that's true, can you use the mysql to connect as your WeBWorK mysql user? For example, I can use$ mysql -u webworkWrite -p webwork

Gavin

### Re: error message

by Danny Glin -
I think Gavin's diagnosis is correct. I suspect that the problem is in the mysql permissions. Did you perform the "GRANT" commands listed in the installation manual while you were still on dhcp? If so, you probably gave the webworkWrite mysql user permission to access the database from the IP address assigned by dhcp. Try executing these again while on the static address. This should hopefully fix the problem.