Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

here the mail.log

server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld
/mysqld.sock' (2)
    Mar 23 23:07:19 ubuntu postfix/trivial-rewrite[6417]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,lock|fold_fix): table lookup problem
    Mar 23 23:07:20 ubuntu postfix/smtpd[6401]: warning: problem talking to service rewrite: Success
    Mar 23 23:07:20 ubuntu postfix/cleanup[6296]: warning: problem talking to service rewrite: Connection reset by peer
    Mar 23 23:07:20 ubuntu postfix/master[6291]: warning: process /usr/lib/postfix/trivial-rewrite pid 6417 exit status 1
    Mar 23 23:07:20 ubuntu postfix/master[6291]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

netstat -l|grep mysql

tcp        0      0 localhost:mysql         *:*                     LISTEN     
unix  2      [ ACC ]     STREAM     LISTENING     10671    /var/run/mysqld/mysqld.sock

and i can connect through this

mysql -u postfix -h 127.0.0.1 -p postfix
share|improve this question
    
Was it ever working before? If so what changed since? What have you tried so far to fix it? –  Yanick Girouard Mar 23 '12 at 21:21
    
no i couldnt make it work –  samer na Mar 23 '12 at 21:23
    
Then ask a local consultant/administrator. –  mailq Mar 23 '12 at 21:46
add comment

3 Answers

Start your local MySQL server.

share|improve this answer
    
thanx for reply but can u explain more –  samer na Mar 23 '12 at 21:21
    
No. You didn't explain either. –  mailq Mar 23 '12 at 21:22
    
Run sudo /sbin/service mysqld start and tell us what it says... –  Yanick Girouard Mar 23 '12 at 21:25
    
root@ubuntu:~# sudo /sbin/service mysqld start sudo: /sbin/service: command not found –  samer na Mar 23 '12 at 21:27
    
Run sudo /usr/sbin/service mysqld start and tell us what it says. –  mailq Mar 23 '12 at 21:47
show 1 more comment

what is your os version and mysql version? depending on what they are, you can use something like /etc/init.d/mysql (could be mysqld in some versions) status to find out if it is running in ubuntu.

then you can use locate mysqld.sock to find out if the socket file is actually in the location postfix user is trying to use.

share|improve this answer
    
im working on Ubuntu 11.10 and mysql is 5.1 –  samer na Mar 24 '12 at 5:32
add comment

MySQL usually has two ways to connect to it: the Unix socket and an IP address.

In the error message above, Postfix is using the socket and your testing is using the IP address.

Check that the socket exists and is where Postfix thinks it is (/var/run/mysqld/mysqld.sock).

Also check that the username and password that Postfix is using work for you through the socket. MySQL permissions care about username, password and the source of the connection. Just because you can connect from one IP address doesn't mean you can from another. This means that with the same username, you can have a different password and permissions if you connect from a different place. This also includes connecting via the Unix socket. Make sure your testing is done the same way Postfix connects.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.