MySQL Forums
Forum List  »  Newbie

I want to create DB using shell script by passing variable
Posted by: Anil G
Date: August 09, 2010 06:28AM

Hi I am very much new to Mysql and shell script.
I want to create a database using shell script.
DB name variable has to be taken from shell script.
Pls help me in this case.
My programme is as follows.
echo "ENTER DB NAME = "
read bugproj
mysql << 'EOF'
create database `$bugproj` CHARACTER SET utf8;
EOF

The above script creates database called $bugproj instead of the input given

Pls help me

Anil(8892938989)

Options: ReplyQuote


Subject
Written By
Posted
I want to create DB using shell script by passing variable
August 09, 2010 06:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.