You should be able to use MySQL for all of the lookups, alias, domain, etc. Looking through the postfix manuals, I found this interesting statement that I think may be related to the problem (link here
. Pay particular attention to the note at the bottom)
hosts The hosts that Postfix will try to connect to and
query from. Specify unix: for UNIX domain sockets,
inet: for TCP connections (default). Example:
hosts = host1.some.domain host2.some.domain : port
hosts = unix:/file/name
The hosts are tried in random order, with all con-
nections over UNIX domain sockets being tried
before those over TCP. The connections are auto-
matically closed after being idle for about 1
minute, and are re-opened as necessary. Postfix
versions 2.0 and earlier do not randomize the host
NOTE: if you specify localhost as a hostname even
if you prefix it with inet:, MySQL will connect to
the default UNIX domain socket. In order to
instruct MySQL to connect to localhost over TCP you
have to specify
hosts = 127.0.0.1
A few more things to check:
1 - check the bind address on which mysql is running and make sure that this hasn't been blocked in a firewall somewhere. This may be why localhost is working, but othe connections are not. The fact that you can connect to mysql via the socket, but postfix can't suggests this probably isn't the problem, but it is worth double checking.
2 - Check your configuration file again. Look very carefully for any form of sytax error, such as a ' versus `, especially if you copied from any how to document.
3 - If you haven't be sure to check your mySQL logs. There may be information as to the problem in there.
This seems to be a semi common problem, but has a few different causes. You might try to Google on the error message "fatal: mysql:/etc/postfix/virtual/domains.cf(0,lock|fold_fix):". Here are a few hits from that with different causes: