change mysql database connect to global variables