There has been a number of posts regarding issue. I followed those and got it resolved for the workbench. I am able to connect through work bench.
But when I try to connect to DB through the code in QT, again the same issue crops up.
Kindly let me know, how to do the same procedure suggested for directly to be incorporated in MYSQL in QT code.