Setting a mysql connect variables at the top

Hi…I do a lot of things with mysql in extension.conf’s include scripts.

I would like to set the connect string as a variable at the top of each script so I do not have to go to every line that i connect to mysql and change it.
Example :

exten => 1,31,MYSQL(connect connid tigger astusr password dbname)
exten => 1,32,MYSQL(query resultid ${connid} select pin from _mobile where MobileNo=’${phone_num}’)
exten => 1,33,MYSQL(fetch fetchid ${resultid} passrd1)

Is there a way to set line 31 as a variable at the top? so i do not have spell out the connect string to connect to mysql ???
I switch between different databases.

You can use global variable.

Can you give me an example ???
I have tried many ways to set it…but find that i am unable to.

Do i have to iniate a connect command everytime i connect to mysql for a select, insert,update or call a stored procedure???
Is there any easy way to do this ??
can you point me to a url or an example of how this can be accomplished???