ssh's -L takes a local port, a remote hostname to connect from the ssh server you connect to, and the remote port. In this case, you'll run:
ssh -L 3307:B.hostname:3306 A.hostname
This will make ssh connect to A, and when you later connect to port 3307 using a local mysql client (mysql -H localhost -P 3307 -u ...
), A's sshd will initiate a connection to B.hostname:3306 for you.