Import MySQL Schema into my database

I have been trying to import a schema into my database through the Shell and using the following syntax:

mysql -h mydatabasehost -u user -p passwd database < schema

All I get is a list of options and nothing happens to the database.

Any suggestions would be greatly appriciated.

mysql -h mydatabasehost -u user -p database < schema

Try that (removed the passwd bit). I think if you are going to enter your password that way, then it needs to be right next to the -p switch

mysql -h mydatabasehost -u user -ppasswd database < schema

Also, if your SQL file has a USE command in it, you don’t need to specify the database. Maybe use schema.sql?

Thanks! The first line worked great! Next time I do it I will try the second line to see what happens.

You are correct. There should not be “passwd” after “-p”. As in another post, if the is removed, it might work.