How to connect to mysql database?

Go to RoR's main website, on the Documentation page there is Tutorial section, go to one of those links and you will get the information that you need.

Welcome aboard, Chris