1

Possible Duplicate:
How to execute Mysql command from a shell script?

I'm trying to execute a .sql file using a bash script. But I am having a problem connecting to MySQL. Here's what I have so far:

#! /bin/sh
PWD="thepassword"
mysql -p -u theuser < Randomsqlfile.sql
echo $PWD

When the password is prompted, nothing fills out.

0

1 Answer 1

4

Make this:

mysql -utheuser -pthepassword <Randomsqlfile.sql
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.