I have a bunch of mysql scripts that use name1 as the database name and populate that database with my data. However, I want to be able to choose the name of the database, instead of always naming it name1 everywhere in my sql scripts.
I already have a wrapper shell script that takes in the path of my data file and now I would like it to also take in the name of the database.
In my shell script, i assign:
DATABASE_NAME=$2
Is there any way at the top of my mysql scripts where I can use $DATABASE_NAME? So in the mysql scripts, it would be:
USE DATABASE_NAME;
instead of what I have right now:
USE name1;
select blah from mydb.table1 ...withmydb.all over the placeCtrl-HFind and Replace. Poof,mydb.goes to blank