Restore mysql tables from .FRM files

Let’s say that you have new server and you have copied all files from there, but you have forgotten to export mysql database. And old server no longer exists. I did this mistake 2-3 times when i migrated to a new computer.:) So, what to do? How to restore mysql tables from files?
If you have full file backup, you should have mysql databases’ files, which have FRM extensions. Search and find them.
In Linux they are in /var/lib/mysql. So
1. Copy ALL folders and files from /var/lib/mysql and paste them into /var/lib/mysql of new server.
2. It will not work immeditially. After pasting you should do mysql restart with folloing command in terminal:
sudo service mysql restart
That’s all.