Couldn't make a database in mysql using bash script ??
Amrit Pal Pathak
amritpalpathak1 at gmail.com
Fri Jul 1 16:48:08 UTC 2011
On Fri, Jul 1, 2011 at 12:40 PM, Avi <lists at avi.co> wrote:
> Amrit Pal Pathak wrote:
> > I used following code to make a database in mysql through bash
> > script.but it couldn't make.it opens the mysql server in terminal
> > just.
> > mysql -u root -p
> > echo "Enter password"
> > read a
> > create database test
> > echo "press ctrl+d "
> > echo "bye"
> Because the
> mysql -u root -p
> is the command to get a shell in the mysql client, it's not a
> programming interface to mysql. The usual way to do this would be to do
> echo "create database test" | mysql -u root -pPassword
> echo "create database test" | mysql -u root -p
How can i pass the mysql root user's password here
Thanks for support !!!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ubuntu-users