HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Postfix MySQL error (http://www.howtoforge.com/forums/showthread.php?t=53628)

alleks 2nd August 2011 11:21

Postfix MySQL error
 
Hi folks, I've already searched the forum for an answer but none worked for me.

I get this error in my mail log:

Code:

Aug  2 11:16:31 orion postfix/proxymap[18942]: warning: connect to mysql server 127.0.0.1: Access denied for user 'ispconfig'@'127.0.0.1' (using password: NO)
Aug  2 11:16:31 orion postfix/trivial-rewrite[19463]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem

I try to login manually with the user and password supplied in mysql-virtual_domains.cf and everything runs smooth, but for some reason won't work by it self. What could it be?

Btw: I have the amavis disabled!

alleks 2nd August 2011 13:06

I don't know why is this happening. When I log in using this

mysql -u ispconfig -ppassword

Everything ok. But when I try to log in the way it shows in the error log, it fails:

mysql -h 127.0.0.1 -u ispconfig -ppassword

cat /etc/hosts
Code:

127.0.0.1      localhost.localdomain  localhost
82.120.120.120  server.xyz.com    server

# The following lines are desirable for IPv6 capable hosts
::1    ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

what could I be doing wrong?

till 2nd August 2011 13:47

According to the error message, postfix does not sue a password for logging in. Please check the file /etc/postfix/mysql-virtual_domains.cf if the password for the ispconfig user is set there.

Then please post the output of:

netstat -tap | grep mysql

and the content of the file /etc/mysql/my.cnf or /etc/my.cnf

alleks 17th August 2011 13:34

Sorry for the delay. I've fixed it, and here is the explication of it

When I was trying to connect to mysql with the -h parameter set to 127.0.0.1
Code:

mysql -u ispconfig  -pHAHA -h 127.0.0.1
I was getting an error that I was not allowed to do so, but if I when I was setting the parameter -h to localhost everything was ok.

Then I tried modifying all the files that were connecting to mysql for postfix and had the value hostname set to 127.0.0.1 to localhost but still no success.

After a while watching logs, searching on the interned I went to phpmyadmin and do some checking there and I noticed that ISPConfig's databases had the permissions set for user ispconfig on host localhost so what I did was to add the same use but with the host set to 127.0.0.1.

That is weird, because 127.0.0.1 and localhost by default should resolv the same thing. I don't know why was that happening but I have fixed the way I just told you.

Good luck if any1 else has this problem.


All times are GMT +2. The time now is 03:09.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.