# HELP - can't login to mysql from courier-imap

## Moriah

I am trying to set up a mail server using the directions found at:

http://wiki.gentoo.org/wiki/User:SwifT/Wikified_but_not_merged_documents/Virtual_mail_HOWTO

I am having problems logging in to mysql from courier-imap.  The syslog at /var/log/messages reads:

```

Sep  3 19:39:23 hophni imapd: Connection, ip=[127.0.0.1]

Sep  3 19:39:23 hophni authdaemond: failed to connect to mysql server (server=localhost, userid=mailsql): Access denied for user 'mailsql'@'localhost' (using password: YES)

Sep  3 19:39:23 hophni imapd: LOGIN FAILED, user=root@elilabs.com, ip=[127.0.0.1]

Sep  3 19:39:28 hophni imapd: LOGOUT, ip=[127.0.0.1], rcvd=55, sent=332

```

My password does contain some weird characters, including the # character, so I tried to find all the places it occurs in the config files and surrounded it with double quotes ("), but it still fails.

Did I miss something, or is this caused by something else?

----------

## nativemad

Hi, 

have you done the mysql-grant part (from the wiki) with a flush privileges afterwards?

Are you able to login from the console with `mysql -u mailsql mailsql`?

Maybe you should try it with a simpler password to get sure it's just that.... 

HTH, cheers

----------

## Moriah

Yes, I can log in from the command line with mysql -u mailsql mailsql, which is why I suspect my password is borking the parser for the imap config files...

PS Sorry about the late response, but other things have taken priority over this.    :Sad: 

----------

## nativemad

Yeah, live is sometimes a b!#!#, as well as courier-imap when it comes to passwords! I once searched for hours and it was just a whitespace behind the password in the configfile!

I'd recommend dovecot over courier any time...

----------

## Moriah

Finally got time to get back to this problem today.  I changed the password and it still doesn't work.    :Evil or Very Mad: 

----------

