A better option is to use a recent PHP version! It must be a very old one you have.
MySQL documentation explains: http://dev.mysql.com…old-client.html
Obviously if you cannot connect with SQLyog then you cannot do it with SQLyog. To SET OLD_PASSWORD for the SQLyog user you will need to do so from a client that can connect and has sufficient privileges (I think SUPER privilege). Or you may edit the configuration file.