Postmap Error: Access Denied for mailuser
postmap: warning: connect to mysql server 127.0.0.1: Access denied for user 'mailuser'@'localhost' (using password: YES)
postmap: fatal: table mysql:/etc/postfix/mysql-virtual-alias-maps.cf: query error: Success
Does this indicate success or failure? The access denied message points to 'mailuser'@'localhost'. Should 'mailuser' be replaced by something else (such as the actual username)?
Thanks for any help.
4 Replies
Check your password for mailuser again in the the file /etc/postfix/mysql-virtual-alias-maps.cf
I have the same problem.
User and password are correct. In fact, I can access mysql>
Here is the cf file:
cat mysql-virtual-mailbox-domains.cf
user = mailuser
password = mypassword
hosts = 127.0.0.1
dbname = mailserver
query = SELECT 1 FROM virtual_domains WHERE name='%s'
if I change user = root, and password = rootpassword
then it works.
But… that is not right, right?
The MySQL administrator (called "root" in your example) IS NOT the same as the super-user account called "root".
If you want to disambiguate them, create a new MySQL user (say "dbadmin") with a different password and give "dbadmin" all the same PRIVILEGEs as the MySQL account "root". Then log in to MySQL as "dbadmin" and delete the MySQL account "root".
With respect to your issue with "mailuser", did you give "mailuser" the correct PRIVILEGE to read the "virtual_domains" table? You should try your query manually using the mysql(1) command shell.
-- sw